LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Custom Icon

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom icon Greg Excel Discussion (Misc queries) 3 October 31st 08 02:16 PM
Add custom icon using VBA SLW612 Excel Programming 3 February 13th 08 04:52 PM
custom icon in custom commandar Tim Rush Excel Programming 2 October 6th 07 04:56 PM
custom icon buttons FSt1 Excel Programming 3 August 15th 05 10:09 PM
custom icon buttons FSt1 Excel Programming 0 August 15th 05 05:52 PM


All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"