ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   i'd like some help using an array (https://www.excelbanter.com/excel-programming/375548-id-like-some-help-using-array.html)

Gary Keramidas

i'd like some help using an array
 
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?
--


Gary





All times are GMT +1. The time now is 10:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com