Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Assigning a macro to a command button

I posted this question earlier today but I forgot to mention an important
item. The right click, assign macro choice is not available with the button I
used (the command button on the control toolbox.) Here's the earlier post.

I accidently used the wrong button and am hoping there is a fix. I need to
run a macro from a button.

I know that if I use the button (control button) from the forms toolbar the
first thing it asks me to do is to assign a macro and all would work fine.
But...

I used the command button from the control toolbox to make the buttons (I
made many of them and would prefer not to remake them). I would like to run a
macro from each of these buttons and now I can't figure out how to attach the
macro to the buttons I've already made. The buttons came from the command
button on the control toolbox.

Is there a way to attach a macro to these buttons?? THANKS !

  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Assigning a macro to a command button

Macros are "assigned" to those buttons in the SheetModule.........here's a
typical example........

Private Sub CommandButton1_Click()
Call YourMacroName
Sheets("Notes").Select
Application.Goto Reference:="R500C1"
Application.Goto Reference:="R72C1"
MsgBox "Hey!....you just pushed my button!"
End Sub


hth
Vaya con Dios,
Chuck, CABGx3


"SheriTingle" wrote:

I posted this question earlier today but I forgot to mention an important
item. The right click, assign macro choice is not available with the button I
used (the command button on the control toolbox.) Here's the earlier post.

I accidently used the wrong button and am hoping there is a fix. I need to
run a macro from a button.

I know that if I use the button (control button) from the forms toolbar the
first thing it asks me to do is to assign a macro and all would work fine.
But...

I used the command button from the control toolbox to make the buttons (I
made many of them and would prefer not to remake them). I would like to run a
macro from each of these buttons and now I can't figure out how to attach the
macro to the buttons I've already made. The buttons came from the command
button on the control toolbox.

Is there a way to attach a macro to these buttons?? THANKS !

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
link to combobox legepe Excel Discussion (Misc queries) 4 July 26th 06 04:45 PM
How to stop Excel remembering/loading macro from previously opened Workbook Norman Yuan Excel Discussion (Misc queries) 4 June 17th 06 04:13 PM
Assigning macro to button d Excel Discussion (Misc queries) 0 August 22nd 05 01:40 PM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM


All times are GMT +1. The time now is 04:32 PM.

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

About Us

"It's about Microsoft Excel"