PC Review


Reply
Thread Tools Rate Thread

Deleting columns/rows

 
 
=?Utf-8?B?ZGNocmlzdG8=?=
Guest
Posts: n/a
 
      31st Oct 2007
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 With Quote
 
 
 
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      31st Oct 2007
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).ClearContents
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 With Quote
 
=?Utf-8?B?ZGNocmlzdG8=?=
Guest
Posts: n/a
 
      31st Oct 2007
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).ClearContents
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting rows or columns Darrell Microsoft Excel Worksheet Functions 1 16th Apr 2009 01:56 AM
Deleting Rows or Columns DGoldwasser Microsoft Excel Misc 1 18th Mar 2009 07:03 PM
Deleting Rows and columns wx4usa Microsoft Excel Misc 3 31st Jul 2007 06:40 AM
Deleting Rows and columns wx4usa Microsoft Excel Misc 2 7th May 2007 11:56 PM
Deleting unneeded rows and columns =?Utf-8?B?bWJpbmc5MTY=?= Microsoft Excel Misc 1 1st May 2007 07:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:05 PM.