+ Reply to Thread
Results 1 to 11 of 11

Repeatedly go to next non-empty cell in column

  1. #1
    Registered User
    Join Date
    02-16-2017
    Location
    North America
    MS-Off Ver
    Office 365 Excel 2016
    Posts
    69

    Repeatedly go to next non-empty cell in column

    January 18, 2019

    Hi,

    What macro steps will allow me to go to the next non-empty cell in a column?

    More specifically, I have a column, let's say A5:A99, and I'd like to know the macro steps such that the selection cursor will go to the next non-empty cell in that range, then when the macro is run again it drops to the NEXT non-empty cell in that column, and so on, until each non-empty cell in the range has been selected, starting at A5 and moving downward.

    If that can be done, can the macro start over at A5 when there are no more non-empty cells, or better yet display a "Last one" message?

    Thanks in advance for any guidance y'all can offer.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,693

    Re: Repeatedly go to next non-empty cell in column

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-16-2017
    Location
    North America
    MS-Off Ver
    Office 365 Excel 2016
    Posts
    69

    Re: Repeatedly go to next non-empty cell in column

    jolivanes, that was quick, and thanks.

    I figured out that if it's really column J whose cells I want to test, I should change the 1 (Column A) to a 10 (Column J). I have no idea what the End(x1Up) part is, but that's OK.

    What I really wanted, though, is for the macro to merely go to the next non-empty cell, which might mean the Select command but I don't know, and then do nothing except wait for me to run the macro again if I want, whereupon the cursor would go that next non-empty cell. Said another way, I don't want to display a message at all until the last non-empty cell has been selected.

  4. #4
    Registered User
    Join Date
    09-21-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    93

    Re: Repeatedly go to next non-empty cell in column

    try this :

    Please Login or Register  to view this content.
    when u run this macro it will select all non-blank cells in column J and when u press enter the next non blank cell will be selected
    Last edited by AliGW; 01-19-2019 at 08:53 AM. Reason: Please remember to use code tags (see the rules)!

  5. #5
    Registered User
    Join Date
    09-21-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    93

    Re: Repeatedly go to next non-empty cell in column

    hi Johnegee

    if u just want to keep selecting non-blank cells after J5 try this
    just select j5, if the cell below it is non empty u can press down arrow or Enter and go to that cell
    else
    press End and Down arrow .
    This also works - no need of macro

  6. #6
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,028

    Re: Repeatedly go to next non-empty cell in column

    Maybe this:

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: Repeatedly go to next non-empty cell in column

    try

    Please Login or Register  to view this content.
    Regards,
    MohanS


    "Perfection is not attainable, but if we chase perfection we can catch excellence." - Vince Lombardi

    You can simply say thanks by clicking "*Add Reputation" icon

  8. #8
    Registered User
    Join Date
    02-16-2017
    Location
    North America
    MS-Off Ver
    Office 365 Excel 2016
    Posts
    69

    Re: Repeatedly go to next non-empty cell in column

    kmahesh, I wasn't able to get your non-macro methods to work. Maybe that's because I use a laptop whose keyboard offers fewer keys.

    Still, thanks for replying.

  9. #9
    Registered User
    Join Date
    02-16-2017
    Location
    North America
    MS-Off Ver
    Office 365 Excel 2016
    Posts
    69

    Re: Repeatedly go to next non-empty cell in column

    akuini, although at first I was concerned there was no reference to a particular range, I have adapted my spreadsheet so your macro works just fine now.

    Thanks for your help.

  10. #10
    Registered User
    Join Date
    02-16-2017
    Location
    North America
    MS-Off Ver
    Office 365 Excel 2016
    Posts
    69

    Re: Repeatedly go to next non-empty cell in column

    mohan.r1980, I wasn't able to figure out how to adapt your code so as not to get an error, and I've since found a macro that works well enough for my purposes.

    Still, thanks for your time.

  11. #11
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,028

    Re: Repeatedly go to next non-empty cell in column

    Quote Originally Posted by Johnegee View Post
    akuini, although at first I was concerned there was no reference to a particular range, I have adapted my spreadsheet so your macro works just fine now.

    Thanks for your help.
    You're welcome & thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Paste formula to the last empty cell based on a non-empty cell on another column
    By bhenlee in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-02-2015, 04:07 PM
  2. Excel VBA evaluate if Cell in column D is empty and Cell in column A is not empty
    By Jovillanueva in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-02-2014, 08:09 PM
  3. Replies: 5
    Last Post: 05-13-2014, 10:19 AM
  4. Need to find empty filled cells in a column and copy to the empty cell below
    By Grahamfeeley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-30-2014, 10:09 AM
  5. Replies: 9
    Last Post: 06-23-2010, 01:13 PM
  6. can't get a macro to work repeatedly on one cell
    By kej in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2006, 12:51 PM
  7. Printing One Column Repeatedly
    By scw1217 in forum Excel General
    Replies: 3
    Last Post: 02-07-2005, 12:37 PM

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