Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In VBA (Excel), I always use something like this:

    LastRow = Range("B64000").End(xlUp).Row

    To give me the last-row in use. I just found out that if I have some of the last rows hidden, this code returns the last visible cell. This is in contrast with double-clicking on the upper-border of a cell below the last cell in the B-column which does bring me to the last cell used.

    I want to know the last cell used; without looping though the cells in the B-column, how do I do that???

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You can use

    LastRow = Range("B:B").Find(What:="*", SearchDirection:=xlPrevious).Row

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='766388' date='20-Mar-2009 14:01']You can use

    LastRow = Range("B:B").Find(What:="*", SearchDirection:=xlPrevious).Row[/quote]


    Works! Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •