S
SN
Good Day,
I currently have a list box running from the following code Everyting is
working perfectly fine it is just that in myarray where i list my Listbox
items I have a total of 96 to select from.
If i get threw a third of my wording I have to start a new row via using the
, underscore, (these are however words not numbers )
example myArray = Array("1 ", "2", "3", _
, "4", "to 96")
Via doing this everthing appears in my listbox but a blank space between the
last listed item and the new listed ie 3 and 4.
I am not to familuar with VBA so might be an extremely stupid question, but
is there a way that i can allow more that allowed on line of code in my
listbox without having a space between the two.
Thank you very much
SN
Code
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim StrSkillList As String
Dim j As Long, k As Long
Dim var, var2, var3
Dim SkillsArray()
k = 1
For var = 1 To lstSkills.ListCount
If lstSkills.Selected(var - 1) = True Then
ReDim Preserve SkillsArray(j)
SkillsArray(j) = lstSkills.List(var - 1)
j = j + 1
End If
Next
For var2 = 0 To UBound(SkillsArray)
ActiveDocument.FormFields("Skill" & k).Result = _
SkillsArray(var2)
k = k + 1
Next
Unload Me
End Sub
Private Sub lstSkills_Click()
End Sub
Private Sub UserForm_Initialize()
Dim var
Dim myArray()
myArray = Array("1 ", "2", "3","4 ", "5", "6", "to 96")
For var = 0 To UBound(myArray)
lstSkills.AddItem myArray(var)
Next
lstSkills.ListIndex = 0
End Sub
I currently have a list box running from the following code Everyting is
working perfectly fine it is just that in myarray where i list my Listbox
items I have a total of 96 to select from.
If i get threw a third of my wording I have to start a new row via using the
, underscore, (these are however words not numbers )
example myArray = Array("1 ", "2", "3", _
, "4", "to 96")
Via doing this everthing appears in my listbox but a blank space between the
last listed item and the new listed ie 3 and 4.
I am not to familuar with VBA so might be an extremely stupid question, but
is there a way that i can allow more that allowed on line of code in my
listbox without having a space between the two.
Thank you very much
SN
Code
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim StrSkillList As String
Dim j As Long, k As Long
Dim var, var2, var3
Dim SkillsArray()
k = 1
For var = 1 To lstSkills.ListCount
If lstSkills.Selected(var - 1) = True Then
ReDim Preserve SkillsArray(j)
SkillsArray(j) = lstSkills.List(var - 1)
j = j + 1
End If
Next
For var2 = 0 To UBound(SkillsArray)
ActiveDocument.FormFields("Skill" & k).Result = _
SkillsArray(var2)
k = k + 1
Next
Unload Me
End Sub
Private Sub lstSkills_Click()
End Sub
Private Sub UserForm_Initialize()
Dim var
Dim myArray()
myArray = Array("1 ", "2", "3","4 ", "5", "6", "to 96")
For var = 0 To UBound(myArray)
lstSkills.AddItem myArray(var)
Next
lstSkills.ListIndex = 0
End Sub