Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks! I had figured out the Count property, but what was holding me back
was not knowing about the ID property. This is what I simplified it to: Sub AddPasteValuesButton() ' adds PasteSpecial Values button to Standard toolbar Dim i As Integer ' if no Standard toolbar we do nothing If Not Application.CommandBars("Standard").Visible Then Exit Sub ' check for existing PasteSpecial Values button For i = 1 To Application.CommandBars("Standard").Controls.Count If Application.CommandBars("Standard").Controls(i).ID = 370 Then Exit Sub Next i ' check for Copy button (so we can paste to its right) For i = 1 To Application.CommandBars("Standard").Controls.Count If Application.CommandBars("Standard").Controls(i).ID = 19 Then Application.CommandBars("Standard").Controls.Add Type:=msoControlButton, ID:=370, Befo=i + 1 Exit Sub End If Next i ' no Copy Button on the toolbar, so place PasteSpecial Values somewhere Application.CommandBars("Standard").Controls.Add Type:=msoControlButton, ID:=370, Befo=10 End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro button on toolbar | Charts and Charting in Excel | |||
Button with macro in toolbar | Charts and Charting in Excel | |||
Command Button for PasteSpecial - Values - Transpose | Excel Discussion (Misc queries) | |||
Toolbar button To Run a Macro? | Excel Programming | |||
How do I make a button to PasteSpecial Values only. | Excel Programming |