Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Array 1

Status
Not open for further replies.

leaf3

Programmer
Nov 19, 2001
7
US
Hello,
I am trying to create an array so that it would look like the following: vtSecurity = "AA", "BB, "CC", "DD". But I can't make it so that both quotation marks would surround each string in the final array. This code is what I could get so far.
If UBound(sSecArray) > 0 Then
For Y = 1 To UBound(sSecArray)

If Y = 1 Then
vtSecurity = sSecArray(Y) & """"
Else
vtSecurity = vtSecurity & "," & " " & SecArray(Y) & """"
End If
Next
End If
Thank you for any ideas.
 
try

vtSecurity = Chr(34) & sSecArrayY) & chr(34)
 
It looks as if you are trying to make a string from an array- correct?
If so here is a short cut:
----------------------------------------
Dim a As Variant, s As String
a = Array("AA", "BB", "CC", "DD")
s = """" & Join(a, """,""") & """" 'this is it.
MsgBox s
----------------------------------------- Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top