+ Reply to Thread
Results 1 to 12 of 12

Moving down one cell at a time starting at a specific cell

  1. #1
    Registered User
    Join Date
    10-28-2011
    Location
    Ontario
    MS-Off Ver
    Excel 2007
    Posts
    30

    Moving down one cell at a time starting at a specific cell

    Hello everyone. What I am looking for is vba code that will allow me to move down one cell at a time starting at a specific cell. For example, always starting at cell C1, then it will proceed to C2, then C3 etc. I would like to place a button on the spreadsheet so that each time the button is pressed it will move one cell down. So, I press the button once and cell C1 is selected, I press the button again and it moves to cell C2, etc. I am able to do this using Active Cell but that means I have to select the starting cell, which is not what I want. Thank you.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,511

    Re: Moving down one cell at a time starting at a specific cell

    Put the below code in a standard module and assign it to a button.
    Please Login or Register  to view this content.
    Note, the counter will reset after closing and reopening the file. If you want it to keep the same number even after that, then you'll need to save the number to a cell somewhere in the file and start from that number next time you open the file.

    BSB
    Last edited by BadlySpelledBuoy; 07-02-2023 at 10:26 AM.

  3. #3
    Registered User
    Join Date
    10-28-2011
    Location
    Ontario
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Moving down one cell at a time starting at a specific cell

    Thanks but this doesn't do exactly what I want it to do. I don't want to close the file to restart the counter. Suppose I want to fill in the cell with the color green, each time I press the button, the cells will become green. If I reset the cells to no fill and press the button again, it will start once again at C1. I hope this makes sense. I can do this using active cell but I was hoping I can do this starting at a specific cell and not having to select the cell myself. Thank you anyways.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,511

    Re: Moving down one cell at a time starting at a specific cell

    That's a much better description than your first post in the thread!

    Maybe this?
    Please Login or Register  to view this content.
    It will find and select the first cell in column C with no interior colouring.

    BSB

  5. #5
    Registered User
    Join Date
    10-28-2011
    Location
    Ontario
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Moving down one cell at a time starting at a specific cell

    This is better but if the cells are not empty it will not move down. Thanks for your help.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,511

    Re: Moving down one cell at a time starting at a specific cell

    I'm confused!

    You said the idea was you'd colour the cells green and you wanted it to go to the next one that isn't....

    Perhaps describe exactly what you need and we can help from there. We're not mind readers!

    BSB

  7. #7
    Registered User
    Join Date
    10-28-2011
    Location
    Ontario
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Moving down one cell at a time starting at a specific cell

    Alright here goes, I press a button and cell C1 is selected and is filled in dark green and the font is white. Now, I press the button again and it moves to cell C2 and does the same thing, I press the button again and it moves to cell C3 and does the same thing etc. Now, if I should remove the color green and set the font back to automatic in Column C and if I press the button again it will start again at cell C1 and repeat the process again. In other words, every time the cells are cleared, pressing the button will start over at cell C1. I hope this clears it up.

  8. #8
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,511

    Re: Moving down one cell at a time starting at a specific cell

    So this amendment to the 2nd try above will find the next non green cell, select it, change the interior colour and font colour. If you clear the colouring it will start at C1 again.
    Please Login or Register  to view this content.
    BSB

  9. #9
    Registered User
    Join Date
    10-28-2011
    Location
    Ontario
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Moving down one cell at a time starting at a specific cell

    Yes, this is exactly what I was looking for. Thank you very much for your help and sorry about the confusion.

  10. #10
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,511

    Re: Moving down one cell at a time starting at a specific cell

    Glad I could help.

    BSB

  11. #11
    Registered User
    Join Date
    10-28-2011
    Location
    Ontario
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Moving down one cell at a time starting at a specific cell

    I'm curious, what if I wanted to start on C4 instead of C1 what would I have to change?

  12. #12
    Registered User
    Join Date
    10-28-2011
    Location
    Ontario
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Moving down one cell at a time starting at a specific cell

    It's okay I figured it out. Thanks everyone!

+ 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. how to find end of row starting from specific cell?
    By jp16 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2018, 02:08 AM
  2. VBA Delete row starting with specific cell
    By klturi421 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2016, 02:14 PM
  3. Replies: 0
    Last Post: 03-29-2015, 08:11 PM
  4. Replies: 0
    Last Post: 09-16-2013, 10:10 AM
  5. copy a cell multiple times depending on cell value starting on a specific cell
    By weritadiojomiel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-17-2013, 05:25 AM
  6. Replies: 5
    Last Post: 09-30-2010, 01:50 PM
  7. Replies: 5
    Last Post: 07-18-2005, 01:05 AM

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