+ Reply to Thread
Results 1 to 6 of 6

Incremental values based on user input

  1. #1
    Registered User
    Join Date
    01-18-2013
    Location
    Hyd
    MS-Off Ver
    Excel 2010
    Posts
    4

    Incremental values based on user input

    I am working on template which gives me the unique ids based on the user input.

    For e.g. I have the unique id in A2 as 20130118 and user enters the number of records in B2 as 13, I would need the incremental value as 2013011801 to 2013011813

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Incremental values based on user input

    You need a macro for this?

    Please Login or Register  to view this content.
    If you like my contribution click the star icon!

  3. #3
    Registered User
    Join Date
    01-18-2013
    Location
    Hyd
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Incremental values based on user input

    Thank you for the macro.

    I tried to change the cell reference values and it is giving me Index out of range error. My unique id is in C2 and number of rows is in C3. I want to start the autofill from A5.

    'set starting point in A5
    ActiveSheet.Range("A5").Value = (ActiveSheet.Range("C2").Value * 100) + 1
    'create a series of x number of rows downwards
    ActiveSheet.Range("A5").AutoFill ActiveSheet.Range("A5").Resize(ActiveSheet.Range("C3").Value), xlFillSeries

  4. #4
    Registered User
    Join Date
    01-18-2013
    Location
    Hyd
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Incremental values based on user input

    I think it worked this time! thanks for you help.

  5. #5
    Registered User
    Join Date
    01-18-2013
    Location
    Hyd
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Incremental values based on user input

    quick question - first time I added 10 rows, I received 10 unique ids. Next time, I added 5 in the rows, nothing is happening till the time I deleted the values. Any idea?

  6. #6
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Incremental values based on user input

    Sorry, I am not entirely certain what you mean by the last post. Perhaps the target area needs to be blank for the autofill to work? Suggest to clear the output area first using

    Please Login or Register  to view this content.

+ 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