Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Clear a sheet

Seek clean alternative to :

Public Sub ClearSheet(sheet As Worksheet)
sheet.Activate
Cells.Select
Selection.ClearContents
Selection.Clear
End Sub

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Clear a sheet

Public Sub ClearSheet(sheet As Worksheet)
sheet.Cells.Clear
End Sub

HTH. Best wishes Harald

skrev i melding
oups.com...
Seek clean alternative to :

Public Sub ClearSheet(sheet As Worksheet)
sheet.Activate
Cells.Select
Selection.ClearContents
Selection.Clear
End Sub

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Clear a sheet

Simply:

Public Sub ClearSheet(sheet As Worksheet)
sheet.Cells.Clear
End Sub

I would change the variable sheet though as I think it
is a reserved word.

RBS


wrote in message
oups.com...
Seek clean alternative to :

Public Sub ClearSheet(sheet As Worksheet)
sheet.Activate
Cells.Select
Selection.ClearContents
Selection.Clear
End Sub

Thanks.


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
Copy Sheet to new Sheet and clear cells on original sheets Boiler-Todd Excel Discussion (Misc queries) 7 September 23rd 09 10:02 PM
msg box to clear a sheet Curt D. Excel Programming 2 January 14th 06 08:00 AM
How to Clear all Data on sheet after a given row Chirs Excel Programming 2 June 7th 05 02:30 AM
Clear all cell in a sheet Alvin Hansen[_2_] Excel Programming 2 November 22nd 04 01:13 PM
Code to clear sheet gregork Excel Programming 5 February 7th 04 06:34 PM


All times are GMT +1. The time now is 03:54 AM.

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"