+ Reply to Thread
Results 1 to 5 of 5

Finding the last row

Hybrid View

  1. #1
    Registered User
    Join Date
    07-30-2010
    Location
    Warrington, England
    MS-Off Ver
    Excel 2010
    Posts
    71

    Lightbulb Finding the last row

    Hi, I'm looking to establish the next empty row for a list that starts at B12 on sheet1. This is the code I'm using

    Sub findlastrow()
    Dim NextRow as long
    
    Sheets("Sheet1").Range("B12").Select
    NextRow = Sheets("Sheet1").Cells(12, 2).End(xlDown).Offset(1, 0).Row
    For some reason I keep coming back with an empty result. Can anyone help please?

    Many thanks in advance

    Mike

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,645

    Re: Finding the last row

    Looking for last row (in title) or next row? That can be different things.

    Try this for last row:

    Dim NextRow as long
    NextRow  = Sheets("Sheet1").Range("B65536").End(xlUp).Row

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Finding the last row

    Mike!
    NextRow = Sheets("Sheet1").Cells(12, 2).End(xlDown).Offset(1, 0).Row
    Need to remove Row
    You could use this code, provided that you have data populuated unitl B11.
    NextRow=Sheets("Sheet1").Range("B" & Rows.Count).End(xlUp).Offset (1)

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Finding the last row

    Try
    NextRow = Sheets("Sheet1").Cells(Rows.Count, 2).End(xlUp).Row + 1
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  5. #5
    Registered User
    Join Date
    07-30-2010
    Location
    Warrington, England
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Finding the last row

    Many thanks for your help guys. All sorted now!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1