farmerscott
Well-known Member
- Joined
- Jan 26, 2013
- Messages
- 824
- Office Version
- 365
- Platform
- Windows
Hi Everybody,
I am trying to get a list of the array elements in the intermediate window.
The code is erroring (code 9) on the debug.Print line.
The elements are being loaded into the array as I am getting the correct value for the variable x.
thanks for the help.
FarmerScottt
I am trying to get a list of the array elements in the intermediate window.
The code is erroring (code 9) on the debug.Print line.
The elements are being loaded into the array as I am getting the correct value for the variable x.
Code:
Sub Data()
Dim lr As Long
Dim x As Long
Dim i As Long
Dim a As Variant
Dim arr() As Variant
Dim b As Long
ScreenUpdating = False
Worksheets("Sheet1").Select
lr = Cells(Rows.Count, "A").End(xlUp).Row
ReDim Preserve arr(1 To lr)
arr = Range("A1:A" & lr)
x = UBound(arr, 1) - LBound(arr, 1) + 1
For i = 0 To UBound(arr)
Debug.Print arr(i) [COLOR=#ff0000]-erroring.[/COLOR]
Next i
End Sub
thanks for the help.
FarmerScottt