hello
during the course of my work i have added many icons to toolbars such as standard or formating. how can i restore the builtin toolbars to there original position?. could it be doen at one stroke?
thanks
Printable View
hello
during the course of my work i have added many icons to toolbars such as standard or formating. how can i restore the builtin toolbars to there original position?. could it be doen at one stroke?
thanks
Try this macro:
[vba]
Option Explicit
Sub Macro1()
Dim CBar As CommandBar
For Each CBar In Application.CommandBars
CBar.Reset
Next
End Sub
[/vba]
hello
i am sorry for being a jerk.
the following macro adds an icon to the standard toolbar.
how can i make sure it will add it only once no matter how many time i shall execute the macro.
[VBA]On Error GoTo errhandler
With Application.CommandBars("formatting").Controls.Add(before:=3)
.Caption = "cell's number format"
.FaceId = 580
.Style = msoButtonIcon
.OnAction = "numberformation"
.BeginGroup = True
End With
Exit Sub
errhandler:
MsgBox " the icon already appear in toolbar"
[/VBA]
thanks
Try this:
[VBA]
Application.CommandBars("Formatting").Controls(3).delete
With Application.CommandBars("formatting").Controls.Add(before:=3)
.Caption = "cell's number format"
.FaceId = 580
.Style = msoButtonIcon
.OnAction = "numberformation"
.BeginGroup = True
End With
Exit Sub
[/VBA]
I just ran your code to create the control. then used the recorder to create the line of code that deletes it.....