Hello all,
I have a Macro that clears any data on different 31 tabs and, due to my
lack of knowledge, I do this one tab at a time. The 31 tabs represent the
maximum possible days in a month. Here's a sample of my Macro:
'======================================================================================================================
' Clear the data on tab 1.
Windows("Revenue Tracker.xls").Activate
Sheets("1").Select
Range("B4:O126").Select
Selection.ClearContents
Range("E4").Select
'----------------------------------------------------------------------------------------------------------------------
' Clear the data on tab 2.
Windows("Revenue Tracker.xls").Activate
Sheets("2").Select
Range("B4:O126").Select
Selection.ClearContents
Range("E4").Select
'----------------------------------------------------------------------------------------------------------------------
I repeat this for every day of the month.
Is there a better way to do this?
Thank you,
Art.
Leo Heuser - 29 Jul 2006 09:38 GMT
> Hello all,
>
[quoted text clipped - 29 lines]
>
> Art.
Hi Art
Here is a shorter version:
Sub ClearTabs()
Dim Counter As Long
Windows("Revenue Tracker.xls").Activate
Application.ScreenUpdating = False
For Counter = 1 To 31
Sheets(CStr(Counter)).Select
Range("B4:O126").ClearContents
Range("E4").Select
Next Counter
Application.ScreenUpdating = True
End Sub

Signature
Best regards
Leo Heuser
Followup to newsgroup only please.
Don Guillett - 29 Jul 2006 13:34 GMT
try
for i=1 to sheets.count
sheets(i).Range("B4:O126").ClearContents
next i

Signature
Don Guillett
SalesAid Software
dguillett1@austin.rr.com
> Hello all,
>
[quoted text clipped - 29 lines]
>
> Art.