ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Convert array (https://www.excelbanter.com/excel-programming/277888-convert-array.html)

Daniel Köster

Convert array
 
Hi,

Is there anyone who can help me with this?
I need to convert the contents of an array to an ordinary variable.
Example,

Array (tjo:tji:tjapp...)

Variable = "tjo,tji,tjapp"

Thanks in advance!

BR
Daniel

--
--------------------------------------------------------
Daniel Köster
TEKNOTRANS AB
Redegatan 13
426 77 Västra Frölunda
Sweden
Tel: +46 31 69 47 60
Fax: +46 31 69 47 65
E-mail:
http://www.teknotrans.com



Leo Heuser[_2_]

Convert array
 
Hi Daniel

If you have Excel 2000 or later,
you can use the "JOIN" function:


Sub Test()
'Leo Heuser, 24 Sept. 2003
Dim ArrayString As Variant
Dim CheckArray As Variant

CheckArray = Array("one", "two", "three")
' Or CheckArray = Array(1, 2, 3)

ArrayString = Join(CheckArray, ",")

MsgBox ArrayString
End Sub



--
Best Regards
Leo Heuser
MVP Excel

Followup to newsgroup only please.

"Daniel Köster" skrev i en meddelelse
...
Hi,

Is there anyone who can help me with this?
I need to convert the contents of an array to an ordinary variable.
Example,

Array (tjo:tji:tjapp...)

Variable = "tjo,tji,tjapp"

Thanks in advance!

BR
Daniel

--
--------------------------------------------------------
Daniel Köster
TEKNOTRANS AB
Redegatan 13
426 77 Västra Frölunda
Sweden
Tel: +46 31 69 47 60
Fax: +46 31 69 47 65
E-mail:
http://www.teknotrans.com





Daniel Köster

Convert array
 
Great! Thank you!

Best regards
Daniel
"Leo Heuser" skrev i meddelandet
...
Hi Daniel

If you have Excel 2000 or later,
you can use the "JOIN" function:


Sub Test()
'Leo Heuser, 24 Sept. 2003
Dim ArrayString As Variant
Dim CheckArray As Variant

CheckArray = Array("one", "two", "three")
' Or CheckArray = Array(1, 2, 3)

ArrayString = Join(CheckArray, ",")

MsgBox ArrayString
End Sub



--
Best Regards
Leo Heuser
MVP Excel

Followup to newsgroup only please.

"Daniel Köster" skrev i en meddelelse
...
Hi,

Is there anyone who can help me with this?
I need to convert the contents of an array to an ordinary variable.
Example,

Array (tjo:tji:tjapp...)

Variable = "tjo,tji,tjapp"

Thanks in advance!

BR
Daniel

--
--------------------------------------------------------
Daniel Köster
TEKNOTRANS AB
Redegatan 13
426 77 Västra Frölunda
Sweden
Tel: +46 31 69 47 60
Fax: +46 31 69 47 65
E-mail:
http://www.teknotrans.com







Leo Heuser[_2_]

Convert array
 
You're welcome.
Thanks for the feedback!

--
Best Regards
LeoH

"Daniel Köster" skrev i en meddelelse
...
Great! Thank you!

Best regards
Daniel





All times are GMT +1. The time now is 01:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com