Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to create leading zeros on variable length numbers | Excel Discussion (Misc queries) | |||
Variable-Length dependent formula | Excel Discussion (Misc queries) | |||
variable length more than 1024 - how to show string complete in excel? | Excel Programming | |||
Filling combobox with variable length list | Excel Programming | |||
Variable-Length String causing error | Excel Programming |