ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   String to Array Conversion (https://www.excelbanter.com/excel-programming/289814-string-array-conversion.html)

Ussiddiqui[_14_]

String to Array Conversion
 
Do any body know that how to convert a String To an Array .... Through
VB , Kindly tell me the function .............. Please Be quick. please
... :-)


---
Message posted from http://www.ExcelForum.com/


A.W.J. Ales

String to Array Conversion
 
Ussiddiqui ,

Would this suffice ?

Function Str2Arr(AString As String)
Dim NRchrs As Integer, I As Integer
Dim StrArr()
NRchrs = Len(AString)
ReDim StrArr(1 To NRchrs)
For I = 1 To NRchrs
StrArr(I) = Mid(AString, I, 1)
Next
Str2Arr = StrArr
End Function

Put in a cell , say A1 the string abcd
In cell B1:E1 put the formula =Str2Arr(A1) and array enter it ( that is
select the four cells, type the formula and then press Cntr + Shift + Enter.
The formula will then be surrounded (in all four cells) with { } (You
should NOT self type these {} ).

a b c and d will be the value in the four cells.

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"Ussiddiqui " wrote in message
...
Do any body know that how to convert a String To an Array .... Through
VB , Kindly tell me the function .............. Please Be quick. please
.. :-)


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 06:11 AM.

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