Dear Team,
Please assist me in resolving the Subscript Out of range in Dynamic Range when Reclaiming Row .
i just store first value and at second getting error.
Code
Option Explicit
Sub Reco()
Dim a, ca(), da(), Nac(), Nad(), Gl(), Dt() As Variant
Dim i As Integer
Dim c, d As Integer
a = Sheet1.Range("A1").CurrentRegion
d = 1
c = 1
For i = LBound(a, 1) To UBound(a, 1)
If IsNumeric(a(i, 9)) = True And a(i, 9) > 0 Then
If IsEmpty(a(i, 4)) = False Then
ReDim Preserve ca(c, 4)
ca(c, 1) = Abs(a(i, 4))
ca(c, 2) = a(i, 2)
ca(c, 3) = a(i, 1)
ca(c, 4) = a(i, 9)
ElseIf IsEmpty(a(i, 5)) = False Then
ReDim Preserve da(d, 4)
da(d, 1) = Abs(a(i, 5))
da(d, 2) = a(i, 2)
da(d, 3) = a(i, 1)
da(d, 4) = a(i, 9)
d = 1 + d
Else: MsgBox "Error"
End If
Else: End If
Next i
End Sub
Display More
Thanks