Customizing the Toolbar

  • Thread starter Thread starter markstro
  • Start date Start date
M

markstro

Is there a way to show a toolbar icon to hide/unhide columns & rows???
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top