Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting rows or columns Darrell[_2_] Excel Worksheet Functions 1 April 16th 09 01:56 AM
Deleting Rows or Columns DGoldwasser Excel Discussion (Misc queries) 1 March 18th 09 07:03 PM
Deleting Rows and columns wx4usa Excel Discussion (Misc queries) 3 July 31st 07 06:40 AM
Deleting Rows and columns wx4usa Excel Discussion (Misc queries) 2 May 7th 07 11:56 PM
Deleting unneeded rows and columns mbing916 Excel Discussion (Misc queries) 1 May 1st 07 07:08 PM


All times are GMT +1. The time now is 03:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"