LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default worksheet loop

Thisworkbook.Activate
for each wks in ThisWorkbook.worksheets
wks.Select
Next

the wks can not be selected if the ThisWorkbook is not the activeworkbook.

--
Regards,
Tom Ogilvy

"Ron de Bruin" wrote in message
...
For Each wks In Worksheets


This is the same as
For Each wks In ActiveWorkbook.Worksheets

Thisworkbook will use the sheets in the workbook where the code is in.


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"scott" wrote in message

...
I think it is working with:

For Each wks In Worksheets
wks.Select

Thanks for you help.



scott wrote:

No. I have tried running it in different workbooks, but I get the

same
error.


Ron de Bruin wrote:

Hi Scott

Do you have hidden worksheets in the workbook??







 
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
Loop thru files in DIR, delete worksheets & reset worksheet Name property?? Mike Taylor Excel Programming 1 October 24th 03 04:14 AM
Loop thru multiple files - Modify worksheet visible property Mike Taylor Excel Programming 1 October 24th 03 04:03 AM
Excel macro to loop through worksheets and graph data from each worksheet deb Excel Programming 5 October 17th 03 05:34 PM
How? Macro to copy range to new worksheet, name new worksheet, loop Repoman Excel Programming 9 October 9th 03 01:45 PM
If... Then Loop problems in Worksheet Event TB[_3_] Excel Programming 2 August 4th 03 08:45 AM


All times are GMT +1. The time now is 10:37 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"