Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile error HELP
Trying to understand more about arrays,,
I have values in cells A11:A19, so when I run: Sub CreateAnArray() Dim MyArray(9) As Long Dim i As Integer Dim R As Range i = 0 Set R = Range("A11:A19") For Each c In R MyArray(i).Value = c.Value ' Bombing Here Compile error!! i = i + 1 Next c End Sub WHY? Thanks,, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile error HELP
Option Explicit
Sub CreateAnArray() Dim MyArray(9) As Long Dim i As Integer Dim R As Range Dim C As Range i = 0 Set R = Range("A11:A19") For Each C In R MyArray(i) = C.Value ' Bombing Here Compile error!! i = i + 1 Next C End Sub Jim May wrote: Trying to understand more about arrays,, I have values in cells A11:A19, so when I run: Sub CreateAnArray() Dim MyArray(9) As Long Dim i As Integer Dim R As Range i = 0 Set R = Range("A11:A19") For Each c In R MyArray(i).Value = c.Value ' Bombing Here Compile error!! i = i + 1 Next c End Sub WHY? Thanks,, -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help with this error-Compile error: cant find project or library | Excel Discussion (Misc queries) | |||
VBAProject name compile error, not defined at compile time | Excel Programming | |||
error message: compile error, argument not optional | Excel Programming | |||
How do I get rid of "Compile error in hidden module" error message | Excel Discussion (Misc queries) |