Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Is it possible to delete rows by the row number and not by the data inside?
I have 300,000 rows and only want to keep 1 of every 5 rows. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
bk2003 wrote:
Is it possible to delete rows by the row number and not by the data inside? I have 300,000 rows and only want to keep 1 of every 5 rows. Which rows do you wan to keep? edvwvw -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200806/1 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
something like
Sub deleterows() For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -5 Rows(i).Offset(1).Resize(4).Delete Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "bk2003" wrote in message ... Is it possible to delete rows by the row number and not by the data inside? I have 300,000 rows and only want to keep 1 of every 5 rows. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I would like to keep every 5th row (i.e. rows 1, 6, 11, 16)
"edvwvw via OfficeKB.com" wrote: bk2003 wrote: Is it possible to delete rows by the row number and not by the data inside? I have 300,000 rows and only want to keep 1 of every 5 rows. Which rows do you wan to keep? edvwvw -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200806/1 |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Where do I put that into Excel? I basically understand what you are telling
me to do, but I just don't know how to put it into Excel to get it to work. Thanks "Don Guillett" wrote: something like Sub deleterows() For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -5 Rows(i).Offset(1).Resize(4).Delete Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "bk2003" wrote in message ... Is it possible to delete rows by the row number and not by the data inside? I have 300,000 rows and only want to keep 1 of every 5 rows. |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you. The only part that didn't work perfectly is the first 5 rows.
But, I can easily delete those manually. Thanks for the macros education! "Don Guillett" wrote: If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Don Guillett Microsoft MVP Excel SalesAid Software "bk2003" wrote in message ... Where do I put that into Excel? I basically understand what you are telling me to do, but I just don't know how to put it into Excel to get it to work. Thanks "Don Guillett" wrote: something like Sub deleterows() For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -5 Rows(i).Offset(1).Resize(4).Delete Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "bk2003" wrote in message ... Is it possible to delete rows by the row number and not by the data inside? I have 300,000 rows and only want to keep 1 of every 5 rows. |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I assumed a header in row 1
-- Don Guillett Microsoft MVP Excel SalesAid Software "bk2003" wrote in message ... Thank you. The only part that didn't work perfectly is the first 5 rows. But, I can easily delete those manually. Thanks for the macros education! "Don Guillett" wrote: If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Don Guillett Microsoft MVP Excel SalesAid Software "bk2003" wrote in message ... Where do I put that into Excel? I basically understand what you are telling me to do, but I just don't know how to put it into Excel to get it to work. Thanks "Don Guillett" wrote: something like Sub deleterows() For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -5 Rows(i).Offset(1).Resize(4).Delete Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "bk2003" wrote in message ... Is it possible to delete rows by the row number and not by the data inside? I have 300,000 rows and only want to keep 1 of every 5 rows. |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Use a helper column with =MOD(ROW(),5)=1, and filter by that.
-- David Biddulph "bk2003" wrote in message ... I would like to keep every 5th row (i.e. rows 1, 6, 11, 16) "edvwvw via OfficeKB.com" wrote: bk2003 wrote: Is it possible to delete rows by the row number and not by the data inside? I have 300,000 rows and only want to keep 1 of every 5 rows. Which rows do you wan to keep? edvwvw -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200806/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I want to delete all even rows? | Excel Discussion (Misc queries) | |||
How to Delete empty rows in excel in b/w rows with values | Excel Worksheet Functions | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions | |||
delete empty rows between rows with text | Excel Discussion (Misc queries) |