Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 249
Default using LEN / LEFT / MID / FIND functions to create a list

[Excel 2003]

I have a vlookup which populates cell $A$1 with codes separated by "-". For
example:

"A3-C-D4-F5"

or

"A-C-D5"

or even

"C"

I would like these to be processed so that
on the rows below $A$1, the idividual items are separated out line by line,
such that

A3-C-D4-F5 would be listed as

A3
C
D4
F5

in the cells below. The codes have "-" in various positions (or none at all
in the case of a single item) and can have up to 7 codes in a string.

Sounds complicated..

Can anyone help me separate the individual items from a hyphenized list of
codes as described above?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 703
Default using LEN / LEFT / MID / FIND functions to create a list

Hi Roger

Paste this event code in the code sheet for the desired sheet.

Private Sub Worksheet_Calculate()
Range("A2:A8").ClearContents
MyArr = Split(Range("A1").Value, "-")
For r = LBound(MyArr) To UBound(MyArr)
Range("A1").Offset(r + 1, 0) = MyArr(r)
Next
End Sub

Regards,
Per

On 14 Sep., 03:23, Roger on Excel
wrote:
[Excel 2003]

I have a vlookup which populates cell $A$1 with codes separated by "-". *For
example:

"A3-C-D4-F5"

or

"A-C-D5"

or even

"C"

I would like these to be processed so that
on the rows below $A$1, the idividual items are separated out line by line,
such that

A3-C-D4-F5 would be listed as

A3
C
D4
F5

in the cells below. *The codes have "-" in various positions (or none at all
in the case of a single item) and can have up to 7 codes in a string.

Sounds complicated..

Can anyone help me separate the individual items from a hyphenized list of
codes as described above?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 249
Default using LEN / LEFT / MID / FIND functions to create a list

Dear Per,

Many thanks for this, however, when I paste it into the sheet VBA page, it
does not seem to work - what do you think?

Regards,

Roger

"Per Jessen" wrote:

Hi Roger

Paste this event code in the code sheet for the desired sheet.

Private Sub Worksheet_Calculate()
Range("A2:A8").ClearContents
MyArr = Split(Range("A1").Value, "-")
For r = LBound(MyArr) To UBound(MyArr)
Range("A1").Offset(r + 1, 0) = MyArr(r)
Next
End Sub

Regards,
Per

On 14 Sep., 03:23, Roger on Excel
wrote:
[Excel 2003]

I have a vlookup which populates cell $A$1 with codes separated by "-". For
example:

"A3-C-D4-F5"

or

"A-C-D5"

or even

"C"

I would like these to be processed so that
on the rows below $A$1, the idividual items are separated out line by line,
such that

A3-C-D4-F5 would be listed as

A3
C
D4
F5

in the cells below. The codes have "-" in various positions (or none at all
in the case of a single item) and can have up to 7 codes in a string.

Sounds complicated..

Can anyone help me separate the individual items from a hyphenized list of
codes as described above?



Reply
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
left and right functions hshayhorn Excel Worksheet Functions 4 July 30th 08 08:16 PM
Use of Find with Left, Mid, Right functions in nested IF(and('s MJW[_2_] Excel Discussion (Misc queries) 8 September 20th 07 09:22 PM
Where can I find list/table of functions/formulas Rich D Excel Discussion (Misc queries) 8 December 10th 06 11:10 PM
where do i find create list in Excel Steph Excel Worksheet Functions 3 November 13th 06 10:06 PM
how do i create a find function for an excel drop list? RC Excel Discussion (Misc queries) 3 March 18th 05 03:09 PM


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