-
How do you concatenate two strings into a list box with spaces between the concatenation. IE, I want to put two string values together using a loop function. Each time it loops it concatenates the two stings and displays them in a list box. Is there something I can use to make the two strings equi-distant apart giving a table-look? Thanks...
-
You can use the Split function and put the string(s) into an array to do this.
Code:
Private Sub Command1_Click()
Dim vArrayName As Variant
Dim strArrName As String
Dim intIndex As Integer
TheString = "Hello World"
vArrayName = Split(TheString, " ")
For intIndex = 0 To UBound(vArrayName)
strArrName = strArrName & vArrayName(intIndex) & vbTab
Next intIndex
MsgBox strArrName
End Sub
-
You could try this:
Code:
listbox.additem string1 & space(30 - len(string1)) & string2
Paul Bousa