Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear Contents in worksheet

Status
Not open for further replies.

mveera

Programmer
Nov 6, 2002
81
US
Hi,

I need to clear all the contents in a worksheet except for the first row. I kinda hardcoded to clear the contents. Is any way where u can clear the contents programatically?

Also i want to the contents in a single column except for the first row.
Please let me know if it is possible to program instead of hardcoding the range.

Thanks
Veera
 
Hardcoding in this case doesn't sound so bad. Especially in the first case, where it is always (?) the first row:

rows("2:65536").clearcontents

For an arbitrary column, you could do

range(cells(2,ColNo),cells(65536,ColNo)).clearcontents

Rob
[flowerface]
 
I agree... and the last column in Excel is IV, so you can use the range "B2:IV65536" to clear everything but the first row and first column.

Christopher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top