I have a listbox in a userform, I have code to populate all the sheets in the workbook in the listbox, looking for code to select multiple sheets in the workbook based on the selected sheet names in the listbox.
The code I have so far will only select one of the sheets selected. see pic
here is the code I have:
Dim i As Integer, sht As String
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
sht = ListBox1.List(i)
End If
Next i
Sheets(sht).Activate
any help greatly appreciated!!
The code I have so far will only select one of the sheets selected. see pic
here is the code I have:
Dim i As Integer, sht As String
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
sht = ListBox1.List(i)
End If
Next i
Sheets(sht).Activate
any help greatly appreciated!!