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  

create a button in spreadsheet



 
 
Thread Tools Display Modes
  #1  
Old May 29th, 2008, 10:22 PM posted to microsoft.public.excel.misc
ann
external usenet poster
 
Posts: 462
Default create a button in spreadsheet

i have just built a macro. how do i create a button in the spreadsheet to
run the macro? for instance, press button and the macro will run, putting in
the answer in the field next to the button?
  #2  
Old May 29th, 2008, 10:38 PM posted to microsoft.public.excel.misc
jatman
external usenet poster
 
Posts: 102
Default create a button in spreadsheet

in Office 2007, use the Developer Tab, insert either a form control or active
x control, and assign the macro to it.

it's been a while since i have had to do it in Office 2003, so i cannot help
in that.

jat


"Ann" wrote:

i have just built a macro. how do i create a button in the spreadsheet to
run the macro? for instance, press button and the macro will run, putting in
the answer in the field next to the button?

  #3  
Old May 29th, 2008, 10:51 PM posted to microsoft.public.excel.misc
FSt1
external usenet poster
 
Posts: 2,788
Default create a button in spreadsheet

hi
if 2003 then
on the menu bar....
viewtoolbarscontrol toolbox. (you can use the forms button but i recommend
the control toolbox button.)
mouse over the controls untill you find command button. click it then click
the sheet and drag to size the button on the sheet.
right click the button and click view code.
Private Sub CommandButton1_Click()
call yourmacroname
End Sub
close the vb editor
right click the button again. click properties.
here you can set button caption, background color, font color and other
properties.
when done close the property box.
mouse over the control toolbar again and click exit design mode. close the
toolbar.

Button should be live and ready to go.

regards
FSt1

"Ann" wrote:

i have just built a macro. how do i create a button in the spreadsheet to
run the macro? for instance, press button and the macro will run, putting in
the answer in the field next to the button?

  #4  
Old May 29th, 2008, 11:02 PM posted to microsoft.public.excel.misc
ann
external usenet poster
 
Posts: 462
Default create a button in spreadsheet

here's the vb editor:

Private Sub ReportCompleted_Click()
Call Macro3
End Sub

when i click the button, it does nothing, i get the 4 arrow when i hover
over it. help.

"FSt1" wrote:

hi
if 2003 then
on the menu bar....
viewtoolbarscontrol toolbox. (you can use the forms button but i recommend
the control toolbox button.)
mouse over the controls untill you find command button. click it then click
the sheet and drag to size the button on the sheet.
right click the button and click view code.
Private Sub CommandButton1_Click()
call yourmacroname
End Sub
close the vb editor
right click the button again. click properties.
here you can set button caption, background color, font color and other
properties.
when done close the property box.
mouse over the control toolbar again and click exit design mode. close the
toolbar.

Button should be live and ready to go.

regards
FSt1

"Ann" wrote:

i have just built a macro. how do i create a button in the spreadsheet to
run the macro? for instance, press button and the macro will run, putting in
the answer in the field next to the button?

  #5  
Old May 29th, 2008, 11:05 PM posted to microsoft.public.excel.misc
ann
external usenet poster
 
Posts: 462
Default create a button in spreadsheet

got it, it works.

"Ann" wrote:

here's the vb editor:

Private Sub ReportCompleted_Click()
Call Macro3
End Sub

when i click the button, it does nothing, i get the 4 arrow when i hover
over it. help.

"FSt1" wrote:

hi
if 2003 then
on the menu bar....
viewtoolbarscontrol toolbox. (you can use the forms button but i recommend
the control toolbox button.)
mouse over the controls untill you find command button. click it then click
the sheet and drag to size the button on the sheet.
right click the button and click view code.
Private Sub CommandButton1_Click()
call yourmacroname
End Sub
close the vb editor
right click the button again. click properties.
here you can set button caption, background color, font color and other
properties.
when done close the property box.
mouse over the control toolbar again and click exit design mode. close the
toolbar.

Button should be live and ready to go.

regards
FSt1

"Ann" wrote:

i have just built a macro. how do i create a button in the spreadsheet to
run the macro? for instance, press button and the macro will run, putting in
the answer in the field next to the button?

  #6  
Old March 26th, 2010, 07:00 PM posted to microsoft.public.excel.misc
Elgee
external usenet poster
 
Posts: 26
Default create a button in spreadsheet

This is fabulous - Thank you!
One additional question - is there a way to avoid creating the button in
every spreadsheet I use? I work with a lot of reports - so I can't use the
"save template" option.

Any suggestions are much appreciated!

"Ann" wrote:

got it, it works.

"Ann" wrote:

here's the vb editor:

Private Sub ReportCompleted_Click()
Call Macro3
End Sub

when i click the button, it does nothing, i get the 4 arrow when i hover
over it. help.

"FSt1" wrote:

hi
if 2003 then
on the menu bar....
viewtoolbarscontrol toolbox. (you can use the forms button but i recommend
the control toolbox button.)
mouse over the controls untill you find command button. click it then click
the sheet and drag to size the button on the sheet.
right click the button and click view code.
Private Sub CommandButton1_Click()
call yourmacroname
End Sub
close the vb editor
right click the button again. click properties.
here you can set button caption, background color, font color and other
properties.
when done close the property box.
mouse over the control toolbar again and click exit design mode. close the
toolbar.

Button should be live and ready to go.

regards
FSt1

"Ann" wrote:

i have just built a macro. how do i create a button in the spreadsheet to
run the macro? for instance, press button and the macro will run, putting in
the answer in the field next to the button?

 




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 03:39 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.