Hello,
I would appreciate if you could help me. I have a file with rows where
some of them need to be deleted when column E is empty. However, there
are several blocks of not empty rows. Therefore, I need the code to be
repeated until column A is empty.
row = 3
column = 5
number_of_notempty_rows = 0
Do While Not IsEmpty(ActiveSheet.Cells(row, column))
row = row + 1
number_of_notempty_rows = number_of_notempty_rows + 1
Loop
Range(Cells(number_of_notempty_rows + 3, 1), Cells
(number_of_notempty_rows + 3 + 8, 1)).EntireRow.Delete
This code only deletes 9 rows after first block of rows but I need to
repeat for other blocks that can have various number of not empty
rows.
Range(Cells(number_of_notempty_rows + 3+x, 1), Cells
(number_of_notempty_rows + 3 + 8+x, 1)).EntireRow.Delete
I think I should first always count not empty rows and then repeat
this code where x is the number of not empty rows. It is always
necessary to delete 9 rows after each block of rows.
Thank you in advance
Ivana
--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
To post to this group, send email to [email protected]
If you find any spam message in the group, please send an email to:
Ayush Jain @ [email protected] or
Ashish Jain @ [email protected]
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!
We reach over 5,200 subscribers worldwide and receive many nice notes about the
learning and support from the group. Our goal is to have 10,000 subscribers by
the end of 2009. Let friends and co-workers know they can subscribe to group at
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---