G
Gary Keramidas
let's say i have a lot of these:
lastrow1 = ws1.Cells(42, "AI").End(xlUp).Row
lastrow2 = ws1.Cells(42, "B").End(xlUp).Row
i want to check to make sure the last row is > 3
i thought i might be able to use an array instead of writing an if statement for
every one.
arr = Array("1","2")
For r = LBound(arr) To UBound(arr)
If "lastrow" & arr(r) < 3 Then
'code here
else
code here
End If
Next
but i cant seem to combine them so they return the value of the variable. is it
possible or should i take another route?
lastrow1 = ws1.Cells(42, "AI").End(xlUp).Row
lastrow2 = ws1.Cells(42, "B").End(xlUp).Row
i want to check to make sure the last row is > 3
i thought i might be able to use an array instead of writing an if statement for
every one.
arr = Array("1","2")
For r = LBound(arr) To UBound(arr)
If "lastrow" & arr(r) < 3 Then
'code here
else
code here
End If
Next
but i cant seem to combine them so they return the value of the variable. is it
possible or should i take another route?