Retrieving the last cell in a column and using this row number in a counter

  • Thread starter Thread starter Luc
  • Start date Start date
L

Luc

I want the row number of the last cell in a column (column A) to be the 'To'
value in the counter below

For cnt = 1 To 500
.......

So i do not want to put 500 there, but the row of the last cell that
contains a value.(there are empty rows!)
Lets say the last cell would be A5412

What do i have to put there in place of the '500'



Thanx,

Luc
 
dim lngLastRow as Long

lngLastRow = cells(rows.count, "A").End(xlUp).Row

for cnt = 1 to lngLastRow
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top