+ Reply to Thread
Results 1 to 15 of 15

VBA code to jump to the next cell with contents within a column

  1. #1
    Registered User
    Join Date
    07-13-2023
    Location
    Loudon Country
    MS-Off Ver
    Office 365
    Posts
    17

    VBA code to jump to the next cell with contents within a column

    Hi, Excel Grus

    I'm hoping to create a VBA code that skip/jump to the next cell with contents (that's not blank) within a set range (i.e. column F10 to F2000).
    I have different texts and numbers written on Column F, but not on every row/cell. the contents range from row 1 to row 2000.

    How can I create a VBA code using a clickable button on the top by freezing panel) and click to go to the next cell with any contents (text or number) within a column? Hoping to save time scrolling down to find the next cell with contents.

    I know how to make the button, but not the VBA code to make it work.
    Let me know if my request is not clear.

    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,387

    Re: VBA code to jump to the next cell with contents within a column

    Record a macro:

    Control + F --> search value = "*" --> OK

  3. #3
    Registered User
    Join Date
    07-13-2023
    Location
    Loudon Country
    MS-Off Ver
    Office 365
    Posts
    17

    Re: VBA code to jump to the next cell with contents within a column

    I'm hoping to loop through only within the range from (Cell F10 thru F2000)

  4. #4
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,387

    Re: VBA code to jump to the next cell with contents within a column

    Ok try this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-13-2023
    Location
    Loudon Country
    MS-Off Ver
    Office 365
    Posts
    17

    Re: VBA code to jump to the next cell with contents within a column

    it shows error/debug...

  6. #6
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,387

    Re: VBA code to jump to the next cell with contents within a column

    Probably no values in that column

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,047

    Re: VBA code to jump to the next cell with contents within a column

    Maybe something like this in a module, then assign to the button.

    Please Login or Register  to view this content.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,427

    Re: VBA code to jump to the next cell with contents within a column

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so. Cross-posts are allowed but you must provide a link to your posts on other sites.

    Please see Forum Rule #7 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. No help to be offered until you provide a link or, for members with fewer than 10 posts, a comment telling us where else you have posted this query.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Registered User
    Join Date
    07-13-2023
    Location
    Loudon Country
    MS-Off Ver
    Office 365
    Posts
    17

    Re: VBA code to jump to the next cell with contents within a column

    This works for me. Thank you a bunch, JEC!

  10. #10
    Registered User
    Join Date
    07-13-2023
    Location
    Loudon Country
    MS-Off Ver
    Office 365
    Posts
    17

    Re: VBA code to jump to the next cell with contents within a column

    This was exactly what I was looking for. Thank you, ByteMarks!

  11. #11
    Registered User
    Join Date
    07-13-2023
    Location
    Loudon Country
    MS-Off Ver
    Office 365
    Posts
    17

    Re: VBA code to jump to the next cell with contents within a column

    One follow up question.
    How can I specify which worksheet/tab, I'm referring to? I have multiple tabs and not sure if it's working correctly..
    the tab name is "Gater"

  12. #12
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,387

    Re: VBA code to jump to the next cell with contents within a column

    If the button is on the same sheet as the sheet where yiu want to search, it is working without sheet reference. Otherwise

    Sheets("Gater").range(…).find(…)

  13. #13
    Registered User
    Join Date
    07-13-2023
    Location
    Loudon Country
    MS-Off Ver
    Office 365
    Posts
    17

    Re: VBA code to jump to the next cell with contents within a column

    Now it's showing error/debug again and highlights "Set f = .Find(what:="*", after:=LastCell, lookat:=xlPart)" somehow.
    It shows Runtime error 13. Type mismatch
    Last edited by green400; 09-12-2023 at 12:54 PM.

  14. #14
    Registered User
    Join Date
    07-13-2023
    Location
    Loudon Country
    MS-Off Ver
    Office 365
    Posts
    17

    Re: VBA code to jump to the next cell with contents within a column

    I"m keep getting stuck on the first find. Do you know why clicking a button with the below macro assigned, won't move the selection to the next find?

  15. #15
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: VBA code to jump to the next cell with contents within a column


    Hi,

    well it's just a guessing challenge without the necessary attachment …

+ 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. Jump To Column based on cell value
    By ionelz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2020, 02:11 PM
  2. [keyboard shortcut] jump to last cell in column
    By boarders paradise in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 08-04-2017, 02:04 PM
  3. [SOLVED] Needing VBA code to clear contents of cell when the contents of another cell is cleared
    By jeh0714 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2016, 03:49 PM
  4. [SOLVED] Make the cursor jump from the last cell of column C to the first cell of column L
    By JOAO12 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-09-2013, 11:47 AM
  5. Replies: 3
    Last Post: 08-19-2012, 06:37 AM
  6. Using text from cell contents to jump to a record
    By Sally27 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-16-2011, 06:51 AM
  7. [SOLVED] I want to jump to a worksheet from a contents sheet
    By John C in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-06-2006, 12:15 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