View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default find and delete empty rows


LastRow = Range("U" & Rows.count).end(xlup).row
for RowCount = LastRow to 7 step - 1
if Range("R" & RowCount) = "" then
Row(RowCount).Delete
end if
next RowCount


"Woodi2" wrote:

I'm trying to create a code that will carry out the following.
Check for entries in column 'U' from cell 7 downover until there are no more
entries in column U (i say this so that it does not check all the way to the
bottom of the sheet and take forever, may be wrong though). Then for every
entry in column 'U', check to see if an entry exists in activecell.offset(0,
18). If no entry exists, delete that row.
I have managed to do this by finding the last row and checking if that is
empty and deletes if it is, but it only works once as I dont know how to loop
and it also only checks if the last row is empty.
Could any of you excel wizards help me out or point me in the right direction.
Thanks
Ian