Hi
Manually:
Write the macro
View, Toolbars, Forms
Click on the "button" icon (top right?)
Draw the button on the sheet and assign the macro
If the macro is not written, right click the button when it is and
assign
in code, this will put a form button on cell A1
Dim myButton as Button
Dim myText as String
With Worksheets("mySheet").Range("A1")
Set myButton =
ActiveWorkbook.Worksheets("mySheet").Buttons.Add _
(.Left,
..Top, .Width, .Height)
End With
With DateButton
.Placement = xlMove
.Caption = myText
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.Orientation = xlhorizontal
.OnAction = "myMacro"
End With
Bruce wrote:
regards
Paul
> I have done this in the past, but it has been several years...
> How do you add a button to the work sheet to run a macro? I have one now on
> the Toolbars, but I want one on the sheet it self so that I can distrubute
> the sheet
>
> Thanks
> Bruce
|