+ Reply to Thread
Results 1 to 3 of 3

Control Button to increment by 1 and then select next cell in row to increment that cell

  1. #1
    Registered User
    Join Date
    03-11-2009
    Location
    Kuala Lumpur
    MS-Off Ver
    Excel 2010
    Posts
    18

    Control Button to increment by 1 and then select next cell in row to increment that cell

    Hi,

    I need a macro code (to be used with a control button) that increments a cell value by 1 and then selects the next cell in the row. Upon clicking the button, increments the selected cell by 1 and moves to the next cell in the row. I want the button to increment cells in 5 columns and upon completing the 5th column, it returns to the first cell value and increments by 1 and so on.

    Background to this request:

    I need to pass a task sequentially between 5 staff, and maintain a count of how many tasks i have passed onto each staff. Right now, i'm manually tracking that in excel.

    I've search the forums and could find code to increment a cell value, but couldnt find an example, where upon incrementing, the selection is the next cell in row and the increment is only on the selected row and is a continuous cycle thereafter.

    Appreciate your assistance in providing code for this specific requirement.

    Best regards,

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Control Button to increment by 1 and then select next cell in row to increment that ce

    Hi

    Try this. If you aren't in the range A1:E1, then it will do nothing. If you are, then it will increment the cell by 1, then move to the next cell to the right. If you end up in F1, then you will be moved back to A1.

    Please Login or Register  to view this content.
    rylo

  3. #3
    Registered User
    Join Date
    03-11-2009
    Location
    Kuala Lumpur
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Control Button to increment by 1 and then select next cell in row to increment that ce

    Thank you rylo. your solution worked like a charm.

    Thank you also for the added functionality of the code to not do anything if the selection is not in the range. I'm very happy with your solution. Can't thank enough.

    Best regards,
    Ram

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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