View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
AD108 AD108 is offline
external usenet poster
 
Posts: 72
Default Find last cell of data

Hi Norman,

What is the (2) for in this statement.

Thanks in advance,

Ariel



"Norman Jones" wrote in message
...
Hi Striker,

Dim LastRow As Long


declares a variable (LastRow) and

the instruction:

LastRow = Cells(Rows.Count, "A").End(xlUp)(2).Row

assigns a value to the LastRow variable.

You may, of course, replace LastRow with any (valid) variable name of your
choice - perhaps iRow might be more intuitive than iCell.

So, completely equivalent to my previous suggestion would be:

Dim iRow As Long

iRow = Cells(Rows.Count, "A").End(xlUp)(2).Row


---
Regards,
Norman



"Striker" wrote in message
...
Thanks this is great, one more question. How can I set a variable to

this
number?

Like

Dim iCell as integer
iCell = LastRow = Cells(Rows.Count, "A").End(xlUp).Row

Thanks