View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Input box with dropdown list of all sheets

Hi Greg,

To find row number of last row use the following. It is generic irrespective
of the number of rows in the worksheet and will be forward compatable with
Excel 2007.

lastrow = Sheets(Target).Cells(Rows.Count, "B").End(xlUp).Row

When deleting rows you must work backwards from the bottom. For instance
when working forward if you want to delete rows 4 and 5. Delete row 4 and row
5 is now row 4. The next iteration is row 5 so new row 4 is skipped.

following is air code so forgive me if any errors but it will give you the
idea.

dim i as long

For i = MyRng.rows.count to 1 step -1
if cells(i,1) = "" Then
cells(i,1).entirerow.delete
end if
next i

--
Regards,

OssieMac