Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Lonnie
Thanks for following up. It's getting late in Connecticut so I will have to try this tomorrow. Will let you know how it turns out. -- Michael Conroy Stamford, CT "Lonnie M." wrote: Michael, I should have read a little closer. The 'OnAction' property is where you would place the name of the public macro that would format your selected cells. 'The public procedure/macro in a Standard Module Public Sub myDateFmt() Selection.NumberFormat = "mm/dd/yyyy" End Sub 'The open event to create the button in the 'ThisWorkbook' Module: Sub Auto_Open() 'Add Buttons to the Standard toolbar 'Change view between normal and pagebreak preview Dim btnCap$ Dim bPVfmt As Object btnCap = "Format As Date" On Error Resume Next Application.CommandBars("Formatting"). _ Controls(btnCap).Delete On Error GoTo 0 Set bPVfmt = Application. _ CommandBars("Formatting"). _ Controls.Add(Type:=msoControlButton, _ Befo=10, temporary:=True) With bPVfmt .FaceId = 9589 'calendar button .Tag = btnCap .Caption = btnCap .OnAction = "myDateFmt" End With End Sub HTH€”Lonnie M. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
custom icon | Excel Discussion (Misc queries) | |||
Add custom icon using VBA | Excel Programming | |||
custom icon in custom commandar | Excel Programming | |||
custom icon buttons | Excel Programming | |||
custom icon buttons | Excel Programming |