making a button


Posted by Patrick on August 29, 2001 11:34 AM

I want to create a button that adds a certain value
(3.08) to a cell whenever it is pressed. How does one
do this?

Posted by Barrie Davidson on August 29, 2001 12:46 PM

To create the button, select Tools|Customize from the main menu. Select the "Commands" tab. Select the "Macros" command (left hand window). Click and drag the custom button (the happy face) to your menu bar. Click on the "Modify Selection" command button in the "Customize" window. Select "Assign Macro" and assign this macro to the button.

Sub Add_Three_Point_Zero_Eight()
' Macro written by Barrie Davidson
If Mid(Selection.Formula, 1, 1) = "=" Then
Selection.Formula = Selection.Formula & "+3.08"
Else
Selection.Formula = "=" & Selection.Formula & "+3.08"
End If
End Sub

If you need any further help with this just let me know.

Regards,
Barrie



Posted by Patrick on August 31, 2001 12:31 PM

Thank you