LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 178
Default clear all sheets code

i'm using the following code to clear/delete anything and everything in already existing sheets:
Sub wbclear()
Dim N As Long
Dim ttl As Long
ttl = ThisWorkbook.Worksheets.Count
For N = 1 To ttl
Worksheets(N).Cells.Delete
Next N
End Sub

what i'd also want is to have cell a1 selected but adding range("a1").select does not work, and i think it's simply because i'm never activating the sheets via code, just deleting the data held in the sheets. is there a bit of code i could use to select cells without activating the sheet?
 
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
Clear all including objects without deleting sheets Curt Excel Programming 0 April 16th 10 02:42 PM
Clear all including objects without deleting sheets Chip Pearson Excel Programming 0 April 15th 10 09:13 PM
Clear Contents of all Sheets [email protected] Excel Programming 4 March 18th 08 09:17 AM
Clear entire rows below last row of data in col A except in 1st 3 sheets Max Excel Programming 6 January 7th 08 10:33 AM
Clear Sheets in Excel Emily[_3_] Excel Programming 11 July 27th 06 04:23 PM


All times are GMT +1. The time now is 08:23 AM.

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

About Us

"It's about Microsoft Excel"