Generate Number Based on Criteria

VbWriter13

New Member
Joined
Mar 17, 2011
Messages
9
Hey-O,

I'm looking to generate a 16-digit number based on information that someone inputs or selects from drop-downs.

For Example, there are 6 criteria and within each, there are several options - based on those options, a specific number is assigned.
Criterion 1 - 01:Material 1; 02: Material 2; 03: Material 3
Criterion 2 - 01:Color 1; 02: Color2; 03:Color 3
Criterion 3 - 01:Size 1; 02: Size 2; 03: Size 3
Criterion 4 - Specific Manufacturer ID
...and so on

So, if I were to pick Material 2, Color 3, Size 1, and type in 0254, it would yield 0203010254 as a number.

Can this be done....seems like a lot to do...

VBW
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Are the drop-downs in your worksheet or in a userform? Are they data-validated cells, form controls or ActiveX controls?

Or do you have nothing yet and you're looking for some pointers?
 
Last edited:
Upvote 0
All of the information is in a spreadsheet and the drop-downs exist in a userform...

Currently, I have one that, based on the same criteria, generates an existing number but I need a way to generate a new number...
 
Upvote 0
So you have three comboboxes on your userform which get their contents from the worksheet and a textbox into which you type a value.

Some sort of event (a command button, perhaps) triggers a bit of code which joins the values of the three comboboxes and the textbox together to form a longer string.

Is that correct?

So what's the basis for generating a new number? Presumably the comboboxes can only ever contain the values they obtained from the worksheet. Are you saying that instead of typing into the textbox, you want a unique number to be generated in some way?

You're probably going to have to post the relevant parts of your code at some point so we can see what it's doing at the moment. If you do that, please place it between CODE tags - the # icon in the advanced editor toolbar.
 
Upvote 0
So far, the only code that I have are the RowSource for the drop-downs...

What I'm thinking is:
If ComboBox1.Value = "Aluminum" Then
PartNumber.Value = "01"

But they would have to be separate text boxes...
 
Upvote 0
Well Pavan, thanks for the outstanding effort...

As it seems, my problem is a little more complex than CONCATENATION!

If you can do that in a UserForm, I would be thrilled! :)
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,741
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top