Results 1 to 3 of 3

Thread: Macro to fill in cells from a column sequentially when I click on a button

  1. #1

    Macro to fill in cells from a column sequentially when I click on a button

    Register for a FREE account, and/
    or Log in to avoid these ads!

    I'm have a lot of trouble trying to figure this out.

    This is my layout:

    Click image for larger version. 

Name:	7bgPbKC.png 
Views:	24 
Size:	9.8 KB 
ID:	3190

    As you can see, I have 2 buttons.
    What I would like each button to do is:
    1. Each time I click on YES, it will insert a Y in a cell in a specific range.
    2. If I click on YES again, it will automatically insert a Y in the next cell under the previous one in the same column.
    3. As you can see, if I have to click on NO, it will also continue down the column and insert an N.

    If someone can help me out with this I'd be very thankful!
    Last edited by MaryZ; 2015-02-20 at 12:20 PM.

  2. #2
    Seeker Gary's Student's Avatar
    Join Date
    Mar 2014
    Lakehurst, NJ, USA
    To the YES button assign this macro:

    Sub YesButton()
        Range("F" & Cells(Rows.Count, "F").End(xlUp).Row + 1).Value = "Y"
    End Sub
    and to the NO button assign this macro:

    Sub NoButton()
        Range("F" & Cells(Rows.Count, "F").End(xlUp).Row + 1).Value = "N"
    End Sub

  3. #3
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Excel Version
    Cross posts:

    and answered.
    MaryZ, please read, especially the section headed "So what's the big deal?" at

    Cross posting is not a problem; not providing links to those helping (so that they don't waste their time duplicating what someone else has already done) is a problem, ultimately for you more than anyone else, should you need more help later. This is because there are relatively few helpers out there compared with those seeking help, and it quickly gets known who the cross posters are, and the help the cross posters receive dwindles.
    Providing links helps the helpers too; they can see other's answers (and clarifications you have given elsewhere) and they can then contribute more appropriately by adding to conversation rather than saying the same things as others have.

Posting Permissions

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