close

Hello All
I need a script to remove every other line in a excel document, starting at
say line 10 and delete line 11,13,15 and so on is this something that can be
done.
Thanks for any help
Scott
Try this:

Just one rule:
Cells A9 through A11 must contain any kind of value

A1: MyCriteria
A2: =ISEVEN(ROW(A10))

Data|Filter|Advanced Filter
List Range: (select from A9 down as far as you need)
Criteria Range: (Select A1:A2)
Click the [OK] button

The filter will only display even numbered rows under A9
Select the filtered rows under A9

Edit|Delete (Excel will only allow you to delete entire rows when a filter
is engaged)

Is that something you can work with?

***********
Regards,
Ron

XL2002, WinXP-Proquot;Sawyerquot; wrote:

gt; Hello All
gt; I need a script to remove every other line in a excel document, starting at
gt; say line 10 and delete line 11,13,15 and so on is this something that can be
gt; done.
gt; Thanks for any help
gt; Scott
gt;
gt;
gt;

Ok I think that just when a little over my head, what do you do with the A1:
MyCriteria A2: =ISEVEN(ROW(A10)) where does this part go I think I got the
rest of it ok.

Thanks
quot;Ron Coderrequot; gt; wrote in message
...
gt; Try this:
gt;
gt; Just one rule:
gt; Cells A9 through A11 must contain any kind of value
gt;
gt; A1: MyCriteria
gt; A2: =ISEVEN(ROW(A10))
gt;
gt; Data|Filter|Advanced Filter
gt; List Range: (select from A9 down as far as you need)
gt; Criteria Range: (Select A1:A2)
gt; Click the [OK] button
gt;
gt; The filter will only display even numbered rows under A9
gt; Select the filtered rows under A9
gt;
gt; Edit|Delete (Excel will only allow you to delete entire rows when a filter
gt; is engaged)
gt;
gt; Is that something you can work with?
gt;
gt; ***********
gt; Regards,
gt; Ron
gt;
gt; XL2002, WinXP-Pro
gt;
gt;
gt; quot;Sawyerquot; wrote:
gt;
gt;gt; Hello All
gt;gt; I need a script to remove every other line in a excel document, starting
gt;gt; at
gt;gt; say line 10 and delete line 11,13,15 and so on is this something that can
gt;gt; be
gt;gt; done.
gt;gt; Thanks for any help
gt;gt; Scott
gt;gt;
gt;gt;
gt;gt;
Another way, insert a new column A by selecting column A and do
insertgt;columns, then in A10 put 1, select A10 and A11, right click the lower
right corner of A11 and drag down as long as you want, when you release the
right mouse button select copy cells. That would give you 1 in A10, blank in
A11, 1 in A12, blank in A13 and so on, now select the range with 1s and
blanks that you have created, press F5, click special and select blanks,
click OK. Now do editgt;delete and when prompted select entire row. Finish by
deleting column A

--

Regards,

Peo Sjoblom

Northwest Excel Solutions

www.nwexcelsolutions.com

(remove ^^ from email address)

Portland, Oregon

quot;Sawyerquot; gt; wrote in message
...
gt; Ok I think that just when a little over my head, what do you do with the
gt; A1: MyCriteria A2: =ISEVEN(ROW(A10)) where does this part go I think I got
gt; the rest of it ok.
gt;
gt; Thanks
gt;
gt;
gt;
gt; quot;Ron Coderrequot; gt; wrote in message
gt; ...
gt;gt; Try this:
gt;gt;
gt;gt; Just one rule:
gt;gt; Cells A9 through A11 must contain any kind of value
gt;gt;
gt;gt; A1: MyCriteria
gt;gt; A2: =ISEVEN(ROW(A10))
gt;gt;
gt;gt; Data|Filter|Advanced Filter
gt;gt; List Range: (select from A9 down as far as you need)
gt;gt; Criteria Range: (Select A1:A2)
gt;gt; Click the [OK] button
gt;gt;
gt;gt; The filter will only display even numbered rows under A9
gt;gt; Select the filtered rows under A9
gt;gt;
gt;gt; Edit|Delete (Excel will only allow you to delete entire rows when a
gt;gt; filter
gt;gt; is engaged)
gt;gt;
gt;gt; Is that something you can work with?
gt;gt;
gt;gt; ***********
gt;gt; Regards,
gt;gt; Ron
gt;gt;
gt;gt; XL2002, WinXP-Pro
gt;gt;
gt;gt;
gt;gt; quot;Sawyerquot; wrote:
gt;gt;
gt;gt;gt; Hello All
gt;gt;gt; I need a script to remove every other line in a excel document, starting
gt;gt;gt; at
gt;gt;gt; say line 10 and delete line 11,13,15 and so on is this something that
gt;gt;gt; can be
gt;gt;gt; done.
gt;gt;gt; Thanks for any help
gt;gt;gt; Scott
gt;gt;gt;
gt;gt;gt;
gt;gt;gt;
gt;
gt;The method exploits a feature of Advanced Filters and eliminates the need to
create helper columns and copy formulas through hundreds, or thousands, of
cells.

Here's the way the criteria section works:
A1: MyCriteria
A2: =ISEVEN(ROW(A10))

Since we are using an formulaic criteria, we can't use column heading that
matches anything in the data list. Hence: MyCriteria

The =ISEVEN(ROW(A10)) formula is located in cell A2, but refers to the first
row of data. When the Advanced Filter runs it sequentially applies that
formula to each cell in column a, beginning in A10.....then it internally
applies it to A11, A12, etc.
For A10 the formula returns TRUE (so the row is shown).
For A11 the formula returns FALSE (so the row is hidden).
etc....to the end of the data list

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Proquot;Sawyerquot; wrote:

gt; Ok I think that just when a little over my head, what do you do with the A1:
gt; MyCriteria A2: =ISEVEN(ROW(A10)) where does this part go I think I got the
gt; rest of it ok.
gt;
gt; Thanks
gt;
gt;
gt;
gt; quot;Ron Coderrequot; gt; wrote in message
gt; ...
gt; gt; Try this:
gt; gt;
gt; gt; Just one rule:
gt; gt; Cells A9 through A11 must contain any kind of value
gt; gt;
gt; gt; A1: MyCriteria
gt; gt; A2: =ISEVEN(ROW(A10))
gt; gt;
gt; gt; Data|Filter|Advanced Filter
gt; gt; List Range: (select from A9 down as far as you need)
gt; gt; Criteria Range: (Select A1:A2)
gt; gt; Click the [OK] button
gt; gt;
gt; gt; The filter will only display even numbered rows under A9
gt; gt; Select the filtered rows under A9
gt; gt;
gt; gt; Edit|Delete (Excel will only allow you to delete entire rows when a filter
gt; gt; is engaged)
gt; gt;
gt; gt; Is that something you can work with?
gt; gt;
gt; gt; ***********
gt; gt; Regards,
gt; gt; Ron
gt; gt;
gt; gt; XL2002, WinXP-Pro
gt; gt;
gt; gt;
gt; gt; quot;Sawyerquot; wrote:
gt; gt;
gt; gt;gt; Hello All
gt; gt;gt; I need a script to remove every other line in a excel document, starting
gt; gt;gt; at
gt; gt;gt; say line 10 and delete line 11,13,15 and so on is this something that can
gt; gt;gt; be
gt; gt;gt; done.
gt; gt;gt; Thanks for any help
gt; gt;gt; Scott
gt; gt;gt;
gt; gt;gt;
gt; gt;gt;
gt;
gt;
gt;

That filter stuff is neat. I need to find out more about it.
What I would have done is write a macro to start at the bottom, and worked
up, deleting and shifting rows.

quot;Ron Coderrequot; wrote:

gt; The method exploits a feature of Advanced Filters and eliminates the need to
gt; create helper columns and copy formulas through hundreds, or thousands, of
gt; cells.
gt;
gt; Here's the way the criteria section works:
gt; A1: MyCriteria
gt; A2: =ISEVEN(ROW(A10))
gt;
gt; Since we are using an formulaic criteria, we can't use column heading that
gt; matches anything in the data list. Hence: MyCriteria
gt;
gt; The =ISEVEN(ROW(A10)) formula is located in cell A2, but refers to the first
gt; row of data. When the Advanced Filter runs it sequentially applies that
gt; formula to each cell in column a, beginning in A10.....then it internally
gt; applies it to A11, A12, etc.
gt; For A10 the formula returns TRUE (so the row is shown).
gt; For A11 the formula returns FALSE (so the row is hidden).
gt; etc....to the end of the data list
gt;
gt; Does that help?
gt;
gt; ***********
gt; Regards,
gt; Ron
gt;
gt; XL2002, WinXP-Pro
gt;
gt;
gt; quot;Sawyerquot; wrote:
gt;
gt; gt; Ok I think that just when a little over my head, what do you do with the A1:
gt; gt; MyCriteria A2: =ISEVEN(ROW(A10)) where does this part go I think I got the
gt; gt; rest of it ok.
gt; gt;
gt; gt; Thanks
gt; gt;
gt; gt;
gt; gt;
gt; gt; quot;Ron Coderrequot; gt; wrote in message
gt; gt; ...
gt; gt; gt; Try this:
gt; gt; gt;
gt; gt; gt; Just one rule:
gt; gt; gt; Cells A9 through A11 must contain any kind of value
gt; gt; gt;
gt; gt; gt; A1: MyCriteria
gt; gt; gt; A2: =ISEVEN(ROW(A10))
gt; gt; gt;
gt; gt; gt; Data|Filter|Advanced Filter
gt; gt; gt; List Range: (select from A9 down as far as you need)
gt; gt; gt; Criteria Range: (Select A1:A2)
gt; gt; gt; Click the [OK] button
gt; gt; gt;
gt; gt; gt; The filter will only display even numbered rows under A9
gt; gt; gt; Select the filtered rows under A9
gt; gt; gt;
gt; gt; gt; Edit|Delete (Excel will only allow you to delete entire rows when a filter
gt; gt; gt; is engaged)
gt; gt; gt;
gt; gt; gt; Is that something you can work with?
gt; gt; gt;
gt; gt; gt; ***********
gt; gt; gt; Regards,
gt; gt; gt; Ron
gt; gt; gt;
gt; gt; gt; XL2002, WinXP-Pro
gt; gt; gt;
gt; gt; gt;
gt; gt; gt; quot;Sawyerquot; wrote:
gt; gt; gt;
gt; gt; gt;gt; Hello All
gt; gt; gt;gt; I need a script to remove every other line in a excel document, starting
gt; gt; gt;gt; at
gt; gt; gt;gt; say line 10 and delete line 11,13,15 and so on is this something that can
gt; gt; gt;gt; be
gt; gt; gt;gt; done.
gt; gt; gt;gt; Thanks for any help
gt; gt; gt;gt; Scott
gt; gt; gt;gt;
gt; gt; gt;gt;
gt; gt; gt;gt;
gt; gt;
gt; gt;
gt; gt;

That filter stuff is great. Just what I had been looking for just this
morning, to temporarily remove a bunch of rows that contain blanks in a
certain column. Now I can get a lot more of the rows I'm looking at on the
screen and don't have to be paging down constantly! You guys are wonderful!

quot;Ron Coderrequot; wrote:

gt; The method exploits a feature of Advanced Filters and eliminates the need to
gt; create helper columns and copy formulas through hundreds, or thousands, of
gt; cells.
gt;
gt; Here's the way the criteria section works:
gt; A1: MyCriteria
gt; A2: =ISEVEN(ROW(A10))
gt;
gt; Since we are using an formulaic criteria, we can't use column heading that
gt; matches anything in the data list. Hence: MyCriteria
gt;
gt; The =ISEVEN(ROW(A10)) formula is located in cell A2, but refers to the first
gt; row of data. When the Advanced Filter runs it sequentially applies that
gt; formula to each cell in column a, beginning in A10.....then it internally
gt; applies it to A11, A12, etc.
gt; For A10 the formula returns TRUE (so the row is shown).
gt; For A11 the formula returns FALSE (so the row is hidden).
gt; etc....to the end of the data list
gt;
gt; Does that help?
gt;
gt; ***********
gt; Regards,
gt; Ron
gt;
gt; XL2002, WinXP-Pro
gt;
gt;
gt; quot;Sawyerquot; wrote:
gt;
gt; gt; Ok I think that just when a little over my head, what do you do with the A1:
gt; gt; MyCriteria A2: =ISEVEN(ROW(A10)) where does this part go I think I got the
gt; gt; rest of it ok.
gt; gt;
gt; gt; Thanks
gt; gt;
gt; gt;
gt; gt;
gt; gt; quot;Ron Coderrequot; gt; wrote in message
gt; gt; ...
gt; gt; gt; Try this:
gt; gt; gt;
gt; gt; gt; Just one rule:
gt; gt; gt; Cells A9 through A11 must contain any kind of value
gt; gt; gt;
gt; gt; gt; A1: MyCriteria
gt; gt; gt; A2: =ISEVEN(ROW(A10))
gt; gt; gt;
gt; gt; gt; Data|Filter|Advanced Filter
gt; gt; gt; List Range: (select from A9 down as far as you need)
gt; gt; gt; Criteria Range: (Select A1:A2)
gt; gt; gt; Click the [OK] button
gt; gt; gt;
gt; gt; gt; The filter will only display even numbered rows under A9
gt; gt; gt; Select the filtered rows under A9
gt; gt; gt;
gt; gt; gt; Edit|Delete (Excel will only allow you to delete entire rows when a filter
gt; gt; gt; is engaged)
gt; gt; gt;
gt; gt; gt; Is that something you can work with?
gt; gt; gt;
gt; gt; gt; ***********
gt; gt; gt; Regards,
gt; gt; gt; Ron
gt; gt; gt;
gt; gt; gt; XL2002, WinXP-Pro
gt; gt; gt;
gt; gt; gt;
gt; gt; gt; quot;Sawyerquot; wrote:
gt; gt; gt;
gt; gt; gt;gt; Hello All
gt; gt; gt;gt; I need a script to remove every other line in a excel document, starting
gt; gt; gt;gt; at
gt; gt; gt;gt; say line 10 and delete line 11,13,15 and so on is this something that can
gt; gt; gt;gt; be
gt; gt; gt;gt; done.
gt; gt; gt;gt; Thanks for any help
gt; gt; gt;gt; Scott
gt; gt; gt;gt;
gt; gt; gt;gt;
gt; gt; gt;gt;
gt; gt;
gt; gt;
gt; gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()