Add a Button Programatically plus code

J

jlclyde

I would like to open a seperate workbook with a macro and add a
button. I would also like to assign the button a macro from the
original workbook.

Then I will need to know how to delete all buttons on a Sheet. Thanks
in advance for any and all help.

thanks,
Jay
 
J

jlclyde

I would like to open a seperate workbook with a macro and add a
button.  I would also like to assign the button a macro from the
original workbook.

Then I will need to know how to delete all buttons on a Sheet.  Thanks
in advance for any and all help.

thanks,
Jay

I have found how to add a button and add code to it. With this.
Sub AddFormsRunButton()
Dim cel As Range, newCB As Object

Set cel = ActiveSheet.Range("L15")

Set newCB = ActiveSheet.Buttons.Add(25, 25, 25, 25)
With newCB
.OnAction = "'Price Quotation Sheet.xls'!Mail"
.Characters.Text = "Send Proposal To Customer"
With .ShapeRange
.Left = cel.Left + 3
.Top = cel.Top + cel.Height - 30
.Width = 90
.Height = 40
End With
With .Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12
.ColorIndex = xlAutomatic
End With
End With

End Sub
I have also found out how to add the code of Mail. But in mail I
would liek to Delete the button that was created and send via email to
another party. Any help?

Thanks,
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top