Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
or more in the spirit of a 3D range
Dim rng As Range, c As Range Dim sh as Worksheet 'Set rng = Range(Sheet1:Sheet9!A2:F15) 'here's my problem bProcess = False for each sh in worksheets if sh.Name = "Sheet1" then bProcess = True if bProcess then set rng = sh.Range("A2:F15") For Each c in rng If c = "-999" Then c = "" ElseIf c 50 Then c = c / 1000000 End If Next End if if sh.Name = "Sheet9" then bProcess = False Next -- Regards, Tom Ogilvy "Bob Phillips" wrote in message ... Doesn't work that way Dim rng As Range, c As Range Dim sh As Worksheet For Each sh In Worksheets(Array("Sheet1", "Sheet2", "Sheet3")) For Each c In sh.Range("A2:F15") If c = "-999" Then c = "" ElseIf c 50 Then c = c / 1000000 End If Next c Next sh -- --- HTH Bob (change the xxxx to gmail if mailing direct) "Mike Fogleman" wrote in message ... I am trying to do a For..Each..Next on a 3D range but can't quite nail the range variable. The range is A2:F15 in 9 worksheets. Dim rng As Range, c As Range Set rng = Range(Sheet1:Sheet9!A2:F15) 'here's my problem For Each c in rng If c = "-999" Then c = "" ElseIf c 50 Then c = c / 1000000 End If Next Mike F |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
automatic range - named range give me circular reference... | Excel Discussion (Misc queries) | |||
Can you get the range reference for each page in a worksheet print range? | Excel Programming | |||
adding reference-to-range control to excel range | Excel Programming | |||
Range Reference | Excel Programming | |||
Subscript out of Range on Range reference | Excel Programming |