LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro bug - looping thru multiple worksheets - workaround?

You were right – the MS work-around worked,
as follows:

Sub Test1()
Dim x As Object
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
For Each x In ActiveWindow.SelectedSheets
ActiveCell.FormulaR1C1 = "=(RC[-4]+RC[-3])"
Range("G2").Select
Next x
End Sub

But this didn’t:

Sub Test1()
Dim x As Object
Sheets(Array("Sheet1",
"Sheet2",
"Sheet3")).Select
For Each x In ActiveWindow.SelectedSheets
ActiveCell.FormulaR1C1 = "=(RC[-4]+RC[-3])"
Range("G2").Select
Next x
End Sub


The reason for listing the sheets in a vertical
fashion is because the actual problem involves
several hundred sheets and wrap-around was cumber-
some.

Any way to reference these sheets in a global
manner, without listing each and every one,
like "Sheet1-Sheet3"?


Much thanks for your time.


Bruce Erlichman



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
how to make a macro to clear multiple cells from multiple worksheets? [email protected] Excel Worksheet Functions 2 October 18th 07 04:31 PM
SUMIF across multiple worksheets workaround help [email protected] Excel Worksheet Functions 4 September 8th 06 07:45 PM
Pivot table page filter not accepting multiple values. Workaround? jco Excel Worksheet Functions 2 September 25th 05 09:35 PM
looping through worksheets Alex ekster Excel Programming 1 July 21st 03 03:16 AM
looping through worksheets alex Excel Programming 0 July 20th 03 06:43 PM


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