Hi
I have recently been working on an addin that allows a user to unhide sheets without having to go to Format>Sheet>Unhide repeatedly. What I would like to do is enable the users to have the ability to select multiple sheets and either Hide or unhide the sheets.
If anyone has any ideas i would be appreciate the help.
TIA
Graeme
Code
Private Sub obVisible_Click()
' Show Visible Sheets
Dim wrkSheets() As String
Dim i As Integer
Dim wrkSheet As Worksheet
ListBox1.Clear
objHide.Enabled = True
objUnhide.Enabled = False
'do this if there are worksheets in the file
If Worksheets.Count > 0 Then
'Declare size of array based on the number of worksheets
ReDim wrkSheets(1 To Worksheets.Count)
'build an array containing then names of all the visible worksheets
For Each wrkSheet In Worksheets
'if worksheet visible, store name in array
If wrkSheet.Visible Then
i = i + 1
wrkSheets(i) = wrkSheet.Name
If wrkSheet.Name <> "" Then ListBox1.AddItem wrkSheet.Name
End If
Next wrkSheet
End If
If ListBox1.ListCount = 0 Then ListBox1.AddItem "(none)"
ListBox1.ListIndex = 0
Display More