Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Need help with cells Array
For Each sht In Sheets(Array("NSB West 2008", "NSB West 2009", "NSB East
2008", "NSB East 2009", "NSB Manhattan")) I am trying to use the line of code below, just like the one above but I am getting a Method 'Range' of object '_Global' failed. Any ideas? Thanks. For Each c In Range(Array("D8", "F8", "H8", "J8", "L8")).Cells |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Need help with cells Array
On Thu, 7 Aug 2008 11:44:02 -0700, Ayo
wrote: For Each sht In Sheets(Array("NSB West 2008", "NSB West 2009", "NSB East 2008", "NSB East 2009", "NSB Manhattan")) I am trying to use the line of code below, just like the one above but I am getting a Method 'Range' of object '_Global' failed. Any ideas? Thanks. For Each c In Range(Array("D8", "F8", "H8", "J8", "L8")).Cells Try this instead: For Each c in Array(Range("D8"),Range("F8"),Range("J8"),Range("L 8")) Hope this helps / Lars-Åke |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Need help with cells Array
How about making an array of strings and get the Range set from them:
Sub dural() s1 = "D8,F8,H8,J8,L8" s2 = Split(s1, ",") For i = 0 To UBound(s2) Set c = Range(s2(i)) MsgBox (c.Address) Next End Sub -- Gary''s Student - gsnu200798 "Ayo" wrote: For Each sht In Sheets(Array("NSB West 2008", "NSB West 2009", "NSB East 2008", "NSB East 2009", "NSB Manhattan")) I am trying to use the line of code below, just like the one above but I am getting a Method 'Range' of object '_Global' failed. Any ideas? Thanks. For Each c In Range(Array("D8", "F8", "H8", "J8", "L8")).Cells |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Need help with cells Array
Sub ParisHiltonForPresident() Dim arr As Variant Dim c As Variant Dim rng As Range arr = Array("D8", "F8", "H8", "J8", "L8") For Each c In arr Set rng = Range(c) MsgBox rng.Text Next Set rng = Nothing End Sub "Ayo" wrote in message For Each sht In Sheets(Array("NSB West 2008", "NSB West 2009", "NSB East 2008", "NSB East 2009", "NSB Manhattan")) I am trying to use the line of code below, just like the one above but I am getting a Method 'Range' of object '_Global' failed. Any ideas? Thanks. For Each c In Range(Array("D8", "F8", "H8", "J8", "L8")).Cells |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Need help with cells Array
For Each c In Range("D8,F8,H8,J8,L8").Cells
Ayo wrote: For Each sht In Sheets(Array("NSB West 2008", "NSB West 2009", "NSB East 2008", "NSB East 2009", "NSB Manhattan")) I am trying to use the line of code below, just like the one above but I am getting a Method 'Range' of object '_Global' failed. Any ideas? Thanks. For Each c In Range(Array("D8", "F8", "H8", "J8", "L8")).Cells -- Dave Peterson |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Need help with cells Array
Ps.
c should be declared as a range: dim c as range Dave Peterson wrote: For Each c In Range("D8,F8,H8,J8,L8").Cells Ayo wrote: For Each sht In Sheets(Array("NSB West 2008", "NSB West 2009", "NSB East 2008", "NSB East 2009", "NSB Manhattan")) I am trying to use the line of code below, just like the one above but I am getting a Method 'Range' of object '_Global' failed. Any ideas? Thanks. For Each c In Range(Array("D8", "F8", "H8", "J8", "L8")).Cells -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
meaning of : IF(Switch; Average(array A, array B); array A) | Excel Worksheet Functions | |||
combining cells and array from different sheets into an array to pass to IRR() | Excel Discussion (Misc queries) | |||
adding cells within an array | Excel Worksheet Functions | |||
Can a UDF be used on an array of cells? | Excel Worksheet Functions | |||
How do I sum an array of cells, even if some of them are #N/A | Excel Discussion (Misc queries) |