You can't select hidden sheets that's why it blow
See how I test if it is visible in this macro
http://www.rondebruin.nl/copy6.htm
You can also use xlSheetVisible instead of -1
Btw: In most cases you not have to select the sheets
--
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
"SteveDB1" wrote in message ...
Hidden worksheets?
Actually, yes, there are. On most all of our workbook files that I'll be
using this on too.
And after I got an answer to this I was going to post on modifying hidden
worksheets with the macro.
How do I resolve that?
I.e., how can I have the macro process ALL ofthe worksheets, including the
hidden ones?
Don, the other macro works great without the "ALL worksheets" component.
It was after I'd added the ALL portion that I got the error.
"Ron de Bruin" wrote:
Do you have a hidden worksheet in your workbook ?
--
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
"SteveDB1" wrote in message ...
Hi all.
Back on April 7, 2006 an individual calling themselves
Yardbird(http://www.microsoft.com/communities...5-233243fafda4)
posted on their desire to run a macro in a workbook to cover all the
worksheets in a workbook.
Gary Brown, Tom Ogilvy, and Bob Phillips responded with their resolution.
I'm now trying the code they used, and get a 1004 error. I did replace the
workbook.worksheets with activeworkbook.worksheets.
Dim sh as Worksheet
for each sh in ActiveWorkbook.Worksheets
sh.Select
'code for my macro here....
Next Sh
It appears to get hung up on the 'sh.select', stating that "sh is nothing."
how do I resolve this to get it working?
(my macro code works great without this, and would like to get it to work
for all worksheets in a single stroke. )
Thank you.
Best.