Bob's code might not work on non-English versions of Excel. If that's what
you have try this:
Sub DisableColHideUnhide()
Dim Ctrls As CommandBarControls
Dim Ctrl As CommandBarControl
Set Ctrls = CommandBars.FindControls(, 886)
For Each Ctrl In Ctrls
Ctrl.Enabled = False
Next
Set Ctrls = CommandBars.FindControls(, 887)
For Each Ctrl In Ctrls
Ctrl.Enabled = False
Next
End Sub
--
Jim
| Hi bob, i get a Runtime error 5
| Invalid procedure call or argument
|
| what is this part ? sheet name or...?
| ("Worksheet Menu Bar").
|
|
| "Bob Phillips" skrev:
|
| > Application.CommandBars("Worksheet Menu
| > Bar").Controls("Format").Controls("Column").Controls("Hide").Enabled =
False
| > 'True
| > Application.CommandBars("Worksheet Menu
| > Bar").Controls("Format").Controls("Column").Controls("Unhide").Enabled =
| > False 'True
| >
| >
| > --
| > HTH
| >
| > Bob
| >
| > (there's no email, no snail mail, but somewhere should be gmail in my
addy)
| >
| > | > > This code disable Format menu (whole menu)
| > >
| > > Application.CommandBars("Format").Enabled = False
| > >
| > > But im just vana disable Show (Format/Columns/Show or (hide)
| > >
| > > hav do i do that ?
| > >
| > > thanks in advance
| >
| >
| >