Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Commandbutton in UserForm to run Macro

i have created 2 commandbutton in UserForm. i also created 2 macros bu
i dont know how to link the commandbuttons in userform to macro.

seeking for help!!!

thanx :rolleyes

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Commandbutton in UserForm to run Macro

in the VBE with the userform visible, double click on the first command
button.

You should see

Private Sub CommandButton1_Click()

End Sub

(it will have the name you assigned you commandbutton)

Put a call to your macro there
Private Sub CommandButton1_Click()
mymacro1
End Sub

In the left dropdown at the top of the module, select the other
commandbutton. In the left dropdown, select click. You should get a
similar declaration and you can call your second macro from there.

--
Regards,
Tom Ogilvy


"salihyil " wrote in message
...
i have created 2 commandbutton in UserForm. i also created 2 macros but
i dont know how to link the commandbuttons in userform to macro.

seeking for help!!!

thanx


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Commandbutton in UserForm to run Macro

thanks Tom Ogilvy

i appriciate

--
Message posted from http://www.ExcelForum.com

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
Can I use a UserForm Box with a Macro? Vick Excel Discussion (Misc queries) 3 May 18th 07 01:32 AM
how do i make a commandbutton run a macro?? Shax New Users to Excel 7 June 7th 06 05:16 PM
CommandButton - Userform Marcia3641 Excel Discussion (Misc queries) 2 July 21st 05 06:39 PM
Macro won't run from CommandButton Nathan Gutman Excel Programming 3 December 24th 03 07:59 PM
Code runs different in a commandbutton than a macro why? Neal Miller Excel Programming 7 December 7th 03 02:41 AM


All times are GMT +1. The time now is 08:23 AM.

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"