View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Deleting columns/rows

This will clear A:Q and T:IV.
range(Cells(2, "A"), cells(rows.count, "Q")).ClearContents
range(Cells(2, "T"), cells(rows.count, columns.count)).ClearContents

Are there and constants in R:S that you want cleared? If so then add this ...
On Error Resume Next
Range("R2", Cells(Rows.Count,
"s")).SpecialCells(xlCellTypeConstants).ClearConte nts
On Error GoTo 0

**Note the above should be 3 lines but it will probably show up as 4 lines.
--
HTH...

Jim Thomlinson


"dchristo" wrote:

I want to clear a worksheet once the workbook opens; however, I don't want to
delete the header row and I don't want to delete/clears functions in column R
and S. How do I accomplish this?