Sure. I have a parts listing document that when created does not spell out every single part but rather will give a list of parts with some dashes to save spaces. For example, I'll have 200 parts S1,S3, S29, S30-S70, S75-S80 etc. I have customers who need me to list every single part by S1,S3,S29,S30,S31,S32 etc. They need every single part listed individually. I would love it if Excel could extract that data rather than me going back into the data on 1,000 of part orders to change the data to meet their request. Does that make sense?
Okay, that helps some. So the basic text to be expanded will always be of a format XXXXaaaa-XXXXbbbb where XXXX could be one or more characters (never numbers) of a "part number range" and then aaaa and bbbb will be the starting and ending range for the suffix of each part number?
Will this range string be a free standing column in Excel, or is it embeded in a longer string (your reply seemed to imply that it could be something like "S1,S3, S29, S30-S70, S75-S80" but perhaps I misunderstood.
Do you already have an Excel sheet with some sample / test data in it, and if so could you upload it here, that would make things easier to understand as well.
In Excel it could be possible to generate the "extrapolation". Would the result be a single string of all the individual part numbers comma delimited, or would they be placed on separate rows, one part number per row or something? And, this is where an example sheet can help a lot to visualize what you are planning.
So a few questions left that need to be answered please. Sorry to be so detail oriented, but it really saves time if we know exactly what is needed before trying to work up a code solution.
Will the basic text to be expanded always be of a format XXXXaaaa-XXXXbbbb where XXXX could be one or more characters (letters, never numbers, hyphen or special characters) of a "part number range" and then aaaa and bbbb will be the starting and ending range for the suffix of each part number?
In the part number cells to be adjusted, will this range string be the only thing in the cell, or is it embeded in a longer string like "S1,S3, S29, S30-S70, S75-S80"?
It sounds like you want a VBA macro that when executed processes all the part numbers in a particular column and expands the ranges updating the cells with the expanded results, correct?
1. That is correct. Text will always be one alphanumerical character followed by a numerical integer. It increases in number but the letter never changes within the cell.
2. It will be embedded into a longer string.
3. Yes.
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.
Can you expand a little bit more about how you will be using this, it might help guide the best approach to a solution.
»bp