Select All Sheets in Workbook
Hi Bob
You're right. I never noticed this. Anyway, you'll have better control
looping the sheets like this:
Sub test()
Dim S As Worksheet
For Each S In ActiveWorkbook.Worksheets
'sample actions:
S.Columns(2).ColumnWidth = 12
S.Range("B2").Value = Time
Next
End Sub
In general macros should not select or activate, they run faster without it
and the user isn't annoyed by the changing sheets or moving cursors.
HTH. Best wishes Harald
"Robert Christie" skrev i melding
...
Hi everyone
I recorded a macro to "Select All Sheets" in a workbook, then make a few
column formatting changes and then "Ungroup Sheets".
But when run as a Sub Procedure only the ActiveSheet is changed.
It appears that selecting all sheets and making any changes manually will
work but not when run as a sub Procedure.
Is this a default condition of Excel, if so is there a work around?
TIA
--
Thank you
Regards
Bob C
Using Windows XP Home + Office 2003 Pro
|