Customizing the Toolbar

  • Thread starter Thread starter markstro
  • Start date Start date
Attach these macros to custom toolbar buttons (you can store them in
your Personal.xls file to make them available to all workbooks):

Public Sub HideCols()
On Error Resume Next
If TypeName(Selection) = "Range" Then _
Selection.EntireColumn.Hidden = True
On Error GoTo 0
End Sub

Public Sub HideRows()
On Error Resume Next
If TypeName(Selection) = "Range" Then _
Selection.EntireRow.Hidden = True
On Error GoTo 0
End Sub

Public Sub UnHideCols()
On Error Resume Next
If TypeName(Selection) = "Range" Then _
Selection.EntireColumn.Hidden = False
On Error GoTo 0
End Sub

Public Sub UnHideRows()
On Error Resume Next
If TypeName(Selection) = "Range" Then _
Selection.EntireRow.Hidden = False
On Error GoTo 0
End Sub
 
You could easily build a macro(s) that hides/unhides all selected
rows/columns and assign them to toolbar icons.

For instance

Sub HideRows ()
Selection.rows.entirerow.hidden=true
End Sub

do something similar for unhide and columns.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top