View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
RogerM RogerM is offline
external usenet poster
 
Posts: 3
Default select contents of entire worksheet

In VBA this seems to work for me


Dim sht As worksheet

Set sht = Worksheets("Balance Sheet")
With sht.Cells
.ClearContents
.ClearOutline
.Clear
End With

"Dave" wrote in message
...
Thanks to everyone, its sorted !!

On Thu, 31 Jul 2003 15:36:54 +0100, Dave <newsgroups@edward-
thompson*nospam*.com wrote:

I'm trying to clear the contents of an entire worksheet
from a macro but I can't find any way of doing this.
I don't want to delete the sheet only clear the contents.

I've gone round in circles with the range(???).clearcontents
style as I can only see that defining the maximum number of
possible cells (ie range("A1:IV65536").clearcontents) will ensure
that the whole sheet is cleared.

Am I just missing something obvious ? or is this the way to do it.

Dave