A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Add a Button Programatically plus code



 
 
Thread Tools Display Modes
  #1  
Old December 9th, 2008, 05:11 PM posted to microsoft.public.excel.misc
jlclyde
external usenet poster
 
Posts: 396
Default Add a Button Programatically plus code

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
  #2  
Old December 9th, 2008, 05:29 PM posted to microsoft.public.excel.misc
jlclyde
external usenet poster
 
Posts: 396
Default Add a Button Programatically plus code

On Dec 9, 10:11*am, jlclyde wrote:
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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.