It's been a long day……I have a listbox (code below) on a userform which produces a list of all worksheets in the workbook. But I want that list to not include the active worksheet the userform is called from. It is always called from codename ShGE04 and named General. Switchboard
A image of it is below
Given time I could work this out, but right now time is something I don't have.
A image of it is below
Given time I could work this out, but right now time is something I don't have.
VBA Code:
Private Sub CommandButton1_Click()
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).Visible = True
ShGE04.Visible = False
Sheets(sht).Activate
End
End Sub