Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2008

Tip: Looking for answers? Try searching our database.

need to find lastrow in "C" column dynamically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Excel-General - 21 Jan 2008 23:13 GMT
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 -
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.