+ Reply to Thread
Results 1 to 3 of 3

(Likely VBA) - Need to create multiple values Based on One cell's value

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2010
    Posts
    1

    (Likely VBA) - Need to create multiple values Based on One cell's value

    Hello,

    I'm a VBA noob. I am building a sheet that will be used to catalog materials at our company.

    Each piece of material will be given a unique code based on an accessionning system I devised (very basic).

    Problem:
    I need to do the following -

    1.) There is a field that says "# of items". This will be a number that will be 1-26.
    2.) I need to assign not only a letter for each number, but a letter for each integer before it.
    3.) I need the output to go to another sheet

    Example:

    User inputs "14" as their number of units in Sheet 1

    On sheet 2, in the corresponding row, 14 rows are created, the cells in one column are populated with the letters A - N.

    Next, user inputs "3" as their number of units in Sheet 1 in the next row

    On sheet 2, in the next available blank row, 3 rows are created, the cells in that one column are populated with the letters A - C

    ...and so on.

    Can anyone help? Thanks!
    Last edited by nobody2000; 09-26-2012 at 04:05 PM.

  2. #2
    Forum Contributor wallyeye's Avatar
    Join Date
    05-06-2011
    Location
    Arizona
    MS-Off Ver
    Office 2010, 2007
    Posts
    308

    Re: (Likely VBA) - Need to create multiple values Based on One cell's value

    Something like this:

    Please Login or Register  to view this content.
    This would go in the module associated with the worksheet you want to monitor. Then, in a new module:

    Please Login or Register  to view this content.
    It will put unexpected values in if a number higher than 26 is entered, but that can be worked around.

  3. #3
    Registered User
    Join Date
    09-26-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: (Likely VBA) - Need to create multiple values Based on One cell's value

    Very cool! Thank you - I'll try it out, and play around with it if we run into the "above 26" problem. I really appreciate your help!

  4. #4
    Registered User
    Join Date
    09-18-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: (Likely VBA) - Need to create multiple values Based on One cell's value

    Just a though here ... why don't you use data validation on Sheet1 to limit the values up to 26?

    Ben

+ 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