0
votes

I am new to VBA and learning; however, I am also running VBA on my MAC instead of PC. That being said, I copy the code down just like I have seen in VBA used by PCs and I get a run-time Error '1004'. Can someone please explain to me why that is?

My code is simple: MonthArray(1) = Range("myMonths").Cells(i,1).value

Thoughts anyone?

Sub Array_OneDimension()
Dim MonthArray(1 To 12) As String
Dim i As Byte

    For i = 1 To 12
        MonthArray(i) = Range("myMonths").Cells(i, 1).Value 'This is where the error is
        
    
    Next i

End Sub

I was expecting the code to loop through the range and pull out the value in the locals window.

What's the error message?Tim Williams
Are you sure that named range is defined on the Mac version of the sheet?braX