Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting columns/rows
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting columns/rows
That was perfect, thank you for your help!!
"Jim Thomlinson" wrote: 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting rows or columns | Excel Worksheet Functions | |||
Deleting Rows or Columns | Excel Discussion (Misc queries) | |||
Deleting Rows and columns | Excel Discussion (Misc queries) | |||
Deleting Rows and columns | Excel Discussion (Misc queries) | |||
Deleting unneeded rows and columns | Excel Discussion (Misc queries) |