I am trying to use specific values from a listbox. I have managed to move this into a different one. But Iam not able to use this values so I am trying to put all the values in a collection to later use them. But i keep having a Mistmatch error
In the ListBox i have the name of different files, and in the collection I suppose to have the full address and the extension of the files for later use.
Private Sub cmdAdd_Click()
Dim intListX As Long, FileName As String, Title As String
For intListX = UserForm1.LstSelected.ListCount - 1 To 0 Step -1
If UserForm1.LstAvail.Selected(intListX) Then
UserForm1.LstSelected.AddItem LstAvail.List(intListX)
FileName = SavePath & UserForm1.LstAvail.List(intListX) & ".txt"
colSelFilesSeq.Add FileName
UserForm1.LstAvail.RemoveItem intListX
End If
Next
' For Each sFile In colSelFileSeq
' MsgBox sFile
' Next sFile
End Sub
In the ListBox i have the name of different files, and in the collection I suppose to have the full address and the extension of the files for later use.
Private Sub cmdAdd_Click()
Dim intListX As Long, FileName As String, Title As String
For intListX = UserForm1.LstSelected.ListCount - 1 To 0 Step -1
If UserForm1.LstAvail.Selected(intListX) Then
UserForm1.LstSelected.AddItem LstAvail.List(intListX)
FileName = SavePath & UserForm1.LstAvail.List(intListX) & ".txt"
colSelFilesSeq.Add FileName
UserForm1.LstAvail.RemoveItem intListX
End If
Next
' For Each sFile In colSelFileSeq
' MsgBox sFile
' Next sFile
End Sub