ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Seperating 1 String into Many strings! (https://www.excelbanter.com/excel-programming/308814-re-seperating-1-string-into-many-strings.html)

Chip Pearson

Seperating 1 String into Many strings!
 
Ben,

You can use the Split function to split the string into an array
of strings.

Dim S As String
Dim Arr As Variant
Dim N As Integer
S = ".00004,.00034,.0024,.008"
Arr = Split(S, ",")
For N = LBound(Arr) To UBound(Arr)
Debug.Print Arr(N)
Next N



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Ben H" wrote in message
...
Hi all! I need to take a string and seperate it into 4

strings. It reads
".00004,.00034,.0024,.008" and i need to put it into 4 seperate

strings,
seperated by the commas

Thanks!





All times are GMT +1. The time now is 09:19 PM.

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