Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Create Variable Length String Dependent Upon Size List

I want to create a string that depends on the number of items in a
list.

For example, say my list looks like the following:

(a1) baseball
(a2) football
(a3) basketball
(a4) hockey
(a5) lacrosse
(a6) soccer

The string that I want will be:

John Doe plays baseball, football, basketball, hockey, lacrosse, and
soccer.

I could just use:

string = "John Doe plays " & A1 & ", " & A2 & ", " & A3 & ", " & A4 &
", " & A5 & ", " & A6 &"."

But the trick is that I won't know ahead of time how many items are in
the list. For one guy it might be three sports in the list and for
another it might be five.

Can I somehow use for/next to create the string with different numbers
of items????

Thx in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Create Variable Length String Dependent Upon Size List

whether the guy has 3 sports or 6 - your existing formula will produce right
answer


"ags5406" wrote in message
oups.com...
I want to create a string that depends on the number of items in a
list.

For example, say my list looks like the following:

(a1) baseball
(a2) football
(a3) basketball
(a4) hockey
(a5) lacrosse
(a6) soccer

The string that I want will be:

John Doe plays baseball, football, basketball, hockey, lacrosse, and
soccer.

I could just use:

string = "John Doe plays " & A1 & ", " & A2 & ", " & A3 & ", " & A4 &
", " & A5 & ", " & A6 &"."

But the trick is that I won't know ahead of time how many items are in
the list. For one guy it might be three sports in the list and for
another it might be five.

Can I somehow use for/next to create the string with different numbers
of items????

Thx in advance.



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
how to create leading zeros on variable length numbers MVPitts Excel Discussion (Misc queries) 4 October 24th 05 06:24 PM
Variable-Length dependent formula chris_manning Excel Discussion (Misc queries) 2 June 16th 05 09:06 PM
variable length more than 1024 - how to show string complete in excel? NorTor[_4_] Excel Programming 1 May 25th 05 12:33 PM
Filling combobox with variable length list Denny Behnfeldt Excel Programming 3 January 2nd 05 06:31 PM
Variable-Length String causing error Q[_2_] Excel Programming 4 December 8th 03 11:31 PM


All times are GMT +1. The time now is 09:54 AM.

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

About Us

"It's about Microsoft Excel"