+ Reply to Thread
Results 1 to 10 of 10

Excel VBA Code for Auto Increment Values

  1. #1
    Registered User
    Join Date
    09-24-2012
    Location
    cebu
    MS-Off Ver
    Excel 2010
    Posts
    20

    Excel VBA Code for Auto Increment Values

    Good Day!! Can Someone Please Help Me Figure Out how to solve this problem? Thanks


    Scenario 1

    A11 = 50 this acts as input box

    So I want A12 and the rest column of A must be incremented by 30 then once numbers approached on 100, the next is back to 1 plus the over of 100

    A12 = 80
    A13 = 10
    A14 = 40
    A15 = 70
    A16 = 100
    A17 = 30
    A18 = 60



    Scenario 2

    A11 = 1 this acts as input box

    So I want A12 and the rest column of A must be incremented by 30 then once numbers approached on 100, the next is back to 1 plus the over of 100

    A12 = 31
    A13 = 61
    A14 = 91
    A15 = 21
    A16 = 51
    A17 = 81
    A18 = 11



    So i want sir that any number i put on A11, the next column must be automatic increment of 30

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Excel VBA Code for Auto Increment Values

    attach please a sample file with data and desired result
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    08-11-2012
    Location
    bengalur
    MS-Off Ver
    Excel 2003, 2007
    Posts
    152

    Re: Excel VBA Code for Auto Increment Values

    Please Login or Register  to view this content.
    In above code what I do is have a pointer to A column & 12 row. Pointer pointing to 12 row is incremented this is done via For Loop.

    Within For loop I have a condition any value above 100 will restart from 10 digit & based on last digit will be retained.
    This is done using concatenation operator &.

    If it is not 100 then add 30 with previous row contents.

    Hope this helps
    ___________________________________________________________________________________________________________________________
    Please click * to say thank You

  4. #4
    Registered User
    Join Date
    09-24-2012
    Location
    cebu
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Excel VBA Code for Auto Increment Values

    Increment.xlsm
    Please See Attached Sample Sir

  5. #5
    Registered User
    Join Date
    09-24-2012
    Location
    cebu
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Excel VBA Code for Auto Increment Values

    Quote Originally Posted by shyamhappy View Post
    Please Login or Register  to view this content.
    In above code what I do is have a pointer to A column & 12 row. Pointer pointing to 12 row is incremented this is done via For Loop.

    Within For loop I have a condition any value above 100 will restart from 10 digit & based on last digit will be retained.
    This is done using concatenation operator &.

    If it is not 100 then add 30 with previous row contents.

    Hope this helps
    ___________________________________________________________________________________________________________________________
    Please click * to say thank You
    it works sir but the amounts were the same/ repetitive!

  6. #6
    Forum Contributor
    Join Date
    08-11-2012
    Location
    bengalur
    MS-Off Ver
    Excel 2003, 2007
    Posts
    152

    Re: Excel VBA Code for Auto Increment Values

    It is based on what input you have put on the A12 cell.

    Based on it the values gets incrementing, Please can you tell after first sequence what sequence you are expecting

  7. #7
    Registered User
    Join Date
    09-24-2012
    Location
    cebu
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Excel VBA Code for Auto Increment Values

    Please See Attached File Sir Above

  8. #8
    Forum Contributor
    Join Date
    08-11-2012
    Location
    bengalur
    MS-Off Ver
    Excel 2003, 2007
    Posts
    152

    Re: Excel VBA Code for Auto Increment Values

    Please Login or Register  to view this content.
    Please try this code, this will work for you.

  9. #9
    Registered User
    Join Date
    09-24-2012
    Location
    cebu
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Excel VBA Code for Auto Increment Values

    Quote Originally Posted by shyamhappy View Post
    Please Login or Register  to view this content.
    Please try this code, this will work for you.
    its not getting what i wanted sir!

  10. #10
    Forum Contributor
    Join Date
    08-11-2012
    Location
    bengalur
    MS-Off Ver
    Excel 2003, 2007
    Posts
    152

    Re: Excel VBA Code for Auto Increment Values

    Please try this macro & let me know if you need any amendments.


    ___________________________________________________________________________________________________
    Please click * to say thank you.
    Attached Files Attached Files

+ 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. [SOLVED] How to create auto increment hyperlinks in excel?
    By jash in forum Excel General
    Replies: 7
    Last Post: 08-06-2012, 10:07 AM
  2. Replies: 3
    Last Post: 02-09-2011, 08:40 PM
  3. Excel number auto increment help!
    By Talmac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2010, 04:52 AM
  4. Auto-increment cell values by one
    By [email protected] in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-30-2005, 12:10 PM
  5. [SOLVED] How do I auto increment cell value on print in Excel
    By Hiren in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-25-2005, 03:06 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