PanzerRanger
New Member
- Joined
- Jan 3, 2018
- Messages
- 20
Why does the debug.printout generate an error (run time 5: Invalid procedure call or argument)? If I print a single item in the array it works. If I use a static array the debug.print works. Also is there a solution to get the printout to show as date, it now prints f.e. 42837 instead of 2017-04-12
Sub test()
Dim nr, a, c As Integer, ary() As Long, info As String, dat as date
lrnr = Blad1.Range("A" & Rows.Count).End(xlUp).Row
nr = lrnr - 25 'Read lrnr as 38
a = 1
c = 26
ReDim ary(a To nr)
Do
dat = Range("A" & c).Value
ary(a) = dat
c = c + 1
a = a + 1
Loop Until c > lrnr
info = Join(ary, vbnewline)
Debug.Print info
End Sub
Sub test()
Dim nr, a, c As Integer, ary() As Long, info As String, dat as date
lrnr = Blad1.Range("A" & Rows.Count).End(xlUp).Row
nr = lrnr - 25 'Read lrnr as 38
a = 1
c = 26
ReDim ary(a To nr)
Do
dat = Range("A" & c).Value
ary(a) = dat
c = c + 1
a = a + 1
Loop Until c > lrnr
info = Join(ary, vbnewline)
Debug.Print info
End Sub