View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Clear contents of worksheet before populating

Tom,

Sure you can. Instead of ActiveSheet, just specify the
appropriate sheet. For example,

Worksheets("Sheet2").Cells.ClearContents


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Tom" wrote in message
...
Hi Chip, In the VB application I'm accessing four separate
worksheets at different times and writing to two others at
different times. I want to clear one certain worksheet at
the beginning of the code. Is there a way to statically
tell the VB code which worksheet to clear?

Thanks
-----Original Message-----
Tom,

Try

ActiveSheet.Cells.Clear
' or
ActiveSheet.Cells.Clear

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Tom" wrote in

message
...
Hi everyone, I need a piece of code that will allow me

to
clear the contents of an entire worksheet so I can
repopulate it with fresh information.

Any suggestions?

Thanks



.