View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Clear all rows except first two


sub clearrows()
dim lr as long
lr = Cells.Find("*", Cells(Rows.Count, Columns.Count) _
, , , xlByRows, xlPrevious).Row
rows(3).resize(lr).delete
end sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Paul Kraemer" wrote in message
...
Hi,

I am using Excel 2007. I want to write a VBA Subroutine to delete/clear
all
data on a particular worksheet except for the first two rows.

This worksheet can have any number of rows filled with data. Can anyone
give me a hint on how I can select and clear all rows containing data
except
for the first two rows?

Thanks in advance,
Paul
--
Paul Kraemer