PDA

View Full Version : how to pick last -1 value of the column



rkulkarn
02-02-2012, 07:03 AM
Hi ,
I want to calculate the last-1 value of the column and use it in for loop. any help will be appriciated.

Thanks
Rajeev

shrivallabha
02-02-2012, 09:26 AM
Welcome to VBAX.

Assuming you want to perform this action on Column A.
Dim lLastRow as Long 'Variable Declaration
lLastRow = Range("A" & Rows.Count).End(xlUp).Row - 1
'Considering you want to loop from Row 2 to lLastRow
For i = 2 to lLastRow
'Loop Action
Next i