I need to get the lastRow dynamically because it can change. This is
not working but I don't know how to revise it. I want the last row in
column C.
lngLastRow = ws.Cells.Find(What:="*", After:=ws.Range("C1"), _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row
This is in a macro and I set a watch on the variable and it was 1. It
looks like it is giving me the first column instead of the last
column.
tia,
Excel-General - 21 Jan 2008 23:56 GMT
I found the problem. What happens is the code is correct but the user
had the cells locked after it.
> I need to get the lastRow dynamically because it can change. This is
> not working but I don't know how to revise it. I want the last row in
[quoted text clipped - 9 lines]
>
> tia,
carlo - 22 Jan 2008 00:51 GMT
Hi tia
If you don't want to use find you could also use this:
IngLastRow = ws.cells(65536,3).end(xlup).row
which gives you the last row with an entry.
hth
Carlo
> I found the problem. What happens is the code is correct but the user
> had the cells locked after it.
[quoted text clipped - 14 lines]
>
> - Show quoted text -