+ Reply to Thread
Results 1 to 7 of 7

focus on first empty row

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Doha, Qatar
    MS-Off Ver
    Excel 2007
    Posts
    12

    focus on first empty row

    hi all ..

    I have a command button , so when click it the focus goes to the first empty row in the worksheet ..
    this is my code ..

    Please Login or Register  to view this content.
    the problem is that this code take me to the first empty row after last filled "A" coluumn

    example

    - A B C D E F
    1 5 4 5 5 - -
    2 8 4 - 6 5 4
    3 - 6 4 - 6 9
    4
    5
    6

    in this example .. MY CODE FOCUS on ROW 3 , BUT I WANT IT TO FOCUS ON 4 BECAUSE THIS IS THE FIRST EMpTY ROW ..

    PLEASE HELP
    Last edited by mabughazza; 05-14-2013 at 02:46 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: insert hyperlink vba

    Use an alternative column to calculate the last row location .. Column B for example .

    Please Login or Register  to view this content.
    Elegant Simplicity............. Not Always

  3. #3
    Registered User
    Join Date
    05-08-2013
    Location
    Doha, Qatar
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: insert hyperlink vba

    no .. the table is not fixed ..

    this is a sample table ..

  4. #4
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    926

    Re: focus on first empty row

    If your table is the only data on that sheet try working on "UsedRange" with something like this:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-08-2013
    Location
    Doha, Qatar
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: focus on first empty row

    unfortunately rollis13..

    same result ..

  6. #6
    Registered User
    Join Date
    05-08-2013
    Location
    Doha, Qatar
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: focus on first empty row

    FOUND THE SOLUTION ..

    Please Login or Register  to view this content.
    THANKS FOR ALL BTW

  7. #7
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    926

    Re: focus on first empty row

    Quote Originally Posted by mabughazza View Post
    unfortunately rollis13..
    same result ..
    Your example table does not match your true data. In your true data you have blank rows on the top.
    All you had to do was add the number of blank rows to the count in the script.

    Anyway, your solution is a working solution without bothering about blank rows.
    Last edited by rollis13; 05-14-2013 at 09:06 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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