LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Expanding numbers and letters in a cell

I created a user defined function just recently that would handle most of it.
I can easily (I just did this) help break out the J1-J3,J8,J10,J12-J15
entries into groups and make it possible to get output like
121-45 J1-J3
121-45 J8
121-45 J10
121-45 J12-15

and I can see adapting that function to split the J1-J3 and J12-J15 items
into individual ones, coming up with the appropriate list. But (there's
always a but), need to know the rules about those entries. Are they always,
and I mean literally ALWAYS, a single letter followed by digits, or can they
be something else like JA1-JA14 or J9K1-J9K12? Or can we attack it by saying
that there will always be numbers at the right end, just work backwards to
the first non-digit character and assume that's the sequence begin/end
numbers and everything to the left of them is going to remain the same?

Depending on the answer to that, I think the UDF could be turned into a
usable macro - wouldn't be totally automatic because it would probably have a
hard time finding the 'source' data items, i.e. the 121-45 and
"J1-J3,J8,J10,J12-J15" entries. But probably by setting up a couple of rules
on how to use it, it could be done. And if things are always going to be one
way, such as where ever the 121-45 is at, the list will be 1 column (or set
number of columns) to the right of it, and from there, save the info, break
up the list and start placing it on the sheet either at the same place 121-45
was at or maybe just below it or whatever and then start putting it there.

But those are details, initial problem is to get format of those Jn things
established.

"tbriggs" wrote:

I have a situation where I have data in a single cell such
as:"J1-J3,J8,J10,J12-J15" I need to expand that cell into individual
cells with J1, J2, J3, J8, J10, J12, J13, J14, J15 in them.

We usually get a bill of materials in excel format that will have a
part number and then all the reference designators associated with that
part number. So the part number of all the reference designators might
be 121-45.

The Excel file would have in cell A1, "121-45" and cell B1 would have
"J1-J3,J8,J10,J12-J15".
I would like some way to convert this to:

Before
A B
1 121-45 J1-J3,J8,J10,J12-J15

After
A B
1 121-45 J1
2 121-45 J2
3 121-45 J3
4 121-45 J8
5 121-45 J10
6 121-45 J12
7 121-45 J13
8 121-45 J14
9 121-45 J15

There is a program called BOM explorer that does a function similar to
that. It is used mainly by contract manufacturers.
Any help would be appreciated.

Thanks!
tbriggs


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting a space between a group of Numbers & Letters in a cell Melissa New Users to Excel 6 May 1st 06 01:35 PM
separating numbers and letters from alphanumeric cell contents PH Excel Worksheet Functions 10 September 3rd 05 12:15 PM
How do I sort letters before numbers in Excel? RiverGirl Excel Discussion (Misc queries) 4 May 27th 05 04:09 PM
VLOOKUP for a cell with both letters and numbers Sonohal Excel Discussion (Misc queries) 6 April 8th 05 02:13 PM
How can I write in a text in a cell using numbers and the letters. Sandy Excel Discussion (Misc queries) 2 January 10th 05 11:49 PM


All times are GMT +1. The time now is 04:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"