shades
09-01-2005, 05:52 PM
Sadly XL on Mac does not appear to allow keyboard shortcuts for Hide Worksheet (on Windows ALT + O + H + H) nor for Unhide Worksheet (ALT + O + H + U). And even in the Customize toolbar there doesn't seem to be any way to access these two commands (Format > Sheet > Hide/Unhide).
So, VBA code seems to be the way to go. It is simple to Hide the activesheet as follows. which then can be assigned to a keyboard shortcut.
Sub HideSheet()
ActiveWindow.SelectedSheets.Visible = False
End Sub
With Unhide it isn't as easy. I am having trouble unhiding, not being able to bring up the dialog box that lists the worksheets that are hidden. This is my initial attempt; it brings up a list of hidden worksheets, and then the person can type in that name. I suppose I could develop a UserForm, but UF can be a pain in XL on the Mac (from my experience).
Sub UnHideSheet()
Dim ws As Worksheet
Dim myList As String
For Each ws In ActiveWorkbook.Worksheets
If ws.Visible = False Then
myList = ws.Name
MsgBox myList
End If
Next ws
Dim mySht As String
mySht = InputBox("What Sheet do you want to unhide?")
Sheets(mySht).Visible = True
End Sub
Anyone have any other ideas?
So, VBA code seems to be the way to go. It is simple to Hide the activesheet as follows. which then can be assigned to a keyboard shortcut.
Sub HideSheet()
ActiveWindow.SelectedSheets.Visible = False
End Sub
With Unhide it isn't as easy. I am having trouble unhiding, not being able to bring up the dialog box that lists the worksheets that are hidden. This is my initial attempt; it brings up a list of hidden worksheets, and then the person can type in that name. I suppose I could develop a UserForm, but UF can be a pain in XL on the Mac (from my experience).
Sub UnHideSheet()
Dim ws As Worksheet
Dim myList As String
For Each ws In ActiveWorkbook.Worksheets
If ws.Visible = False Then
myList = ws.Name
MsgBox myList
End If
Next ws
Dim mySht As String
mySht = InputBox("What Sheet do you want to unhide?")
Sheets(mySht).Visible = True
End Sub
Anyone have any other ideas?