+ Reply to Thread
Results 1 to 6 of 6

Increment cell value and move to next cell

  1. #1
    Registered User
    Join Date
    05-28-2012
    Location
    Croatia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Increment cell value and move to next cell

    I have a big problem with creating a macro in Excel so I will be very greateful if anyone can help me.
    I want to create macro that will have three buttons.
    Starting values of all cells are 0. Each time I press button 1, value of the cells in column C will increment by 1 and write into next row. In the same time value of column D will copy to next row. When I press button 2 same thing will happen only with column D, and column C will copy to next row.

    For example:
    C1=0, D1=0 -> press button 1 -> C1=1, D1=0 -> press button 1 -> C2=2, D2=0 -> press button 2 -> C3=2, D3=1 -> press button 1 -> C4=3, D4=1,
    and so on and on each time I press any of these two buttons

    Third button will do the step back and undo any change made by pressing button 1 or button 2.

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Increment cell value and move to next cell

    see attachment
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-28-2012
    Location
    Croatia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Increment cell value and move to next cell

    Thank you nilem for your help and fast response.
    I've tried your macro and found one problem. If I start procedure with button 2 it does not work.
    If you can solve this I would be very grateful.

  4. #4
    Registered User
    Join Date
    04-09-2012
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Increment cell value and move to next cell

    tichvra,

    Check if this work: Книга1.xlsm

  5. #5
    Registered User
    Join Date
    05-28-2012
    Location
    Croatia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Increment cell value and move to next cell

    Thank you Pulsus. It works perfectly.
    Thanks again

  6. #6
    Registered User
    Join Date
    04-09-2012
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Increment cell value and move to next cell

    tichvra,

    You are welcome, don´t forget to mark your thread as SOLVED.

    Thanks,

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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