LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Splitting cell entries of variable length

Hi,

I would like to have a Macro to split the text entries in one cell into
two or more other cells.

eg: if the entries are like:

Cell D2 : "CX55742A-CI CY55742AAA-CI#"
Cell D3: "BY58575B-BB"
Cell D4: "95033 95982111S 95982199"
Cell D5: "01722000 05134800 05317500 74710286 74710286
95052924"
etc,

what i would like to do is to split D2 into:

E2: "CX55742A-CI"
F2: "CY55742AAA-CI#",

split D4 into:
E4: 95033
F4: 95982111S
G4: 95982199

etc

I guess I should read from the left, look for spaces in the text, and
split the entry right where the space is, move to the next actual text
entry, etc. However, please note that:

1. I dont know in advance how many sub-text entries are going to be in
one cell, so I dont know how many columns I'd be splitting this into

2. The part numbers have different string lengths, so I cant use the
easier way of saying "pick the first 8 characters and put em in E2, the
next 5 in F2, etc

Do you think you could help me with this? Thanks a lot in advance.

Joe.

 
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
Sum variable range of column entries in offset cell Struggling in Sheffield[_2_] New Users to Excel 5 October 10th 09 05:16 PM
How do I set up a Chart in Excel with variable cell length? Kev Charts and Charting in Excel 1 November 2nd 07 12:02 PM
Change the length of the dropdown list used to cell entries Anastasia Excel Discussion (Misc queries) 3 January 24th 07 04:21 AM
how do I do a variable length array based on the value in a cell Mark Pranger Excel Discussion (Misc queries) 1 January 25th 06 07:01 AM
how to sum numeric values of column (variable length) in 1st available blank cell grimjim Excel Programming 1 October 18th 04 09:54 PM


All times are GMT +1. The time now is 01:58 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"