Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Quick Question: Buttons

I have all my code in ThisWorkbook and I have a button in Sheet 1. How
do I get the button in Sheet 1 to point at some functions in
ThisWorkbook?

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Quick Question: Buttons

lol...nevermind. Figured it out.

ThisWorkbook.(insert Function name here)

Thanks anyways.

Mazin wrote:
I have all my code in ThisWorkbook and I have a button in Sheet 1. How
do I get the button in Sheet 1 to point at some functions in
ThisWorkbook?

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
zz zz is offline
external usenet poster
 
Posts: 32
Default Quick Question: Buttons

another alternative

in a normal module

sub command101
msgbox "hello world"
end sub

in the button

run "command101"

the run command calls a macro by its name, this is really useful for using
the same button to do different actions based on user input

EG.

private sub my_suigeneris_button_click()

if the_global_var="something" then
run "My_something_sub"
else
run "my_something_else_sub"
end if

end sub


--
---
zz [MX]
cuasi-musico,semi-poeta y loco


"Mazin" wrote in message
oups.com...
I have all my code in ThisWorkbook and I have a button in Sheet 1. How
do I get the button in Sheet 1 to point at some functions in
ThisWorkbook?

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
zz zz is offline
external usenet poster
 
Posts: 32
Default Quick Question: Buttons

this fingers!!

resuming where i accidentally hit the return key

---------------this---------------------
private sub my_suigeneris_button_click()

if the_global_var="something" then
run "My_something_sub"
else
run "my_something_else_sub"
end if

end sub



would be replaced by

--------------this-----------------------

private sub my_suigeneris_button_click()

run the_global_var

end sub



"zz" wrote in message
...
another alternative

in a normal module

sub command101
msgbox "hello world"
end sub

in the button

run "command101"

the run command calls a macro by its name, this is really useful for using
the same button to do different actions based on user input

EG.

private sub my_suigeneris_button_click()

if the_global_var="something" then
run "My_something_sub"
else
run "my_something_else_sub"
end if

end sub


--
---
zz [MX]
cuasi-musico,semi-poeta y loco


"Mazin" wrote in message
oups.com...
I have all my code in ThisWorkbook and I have a button in Sheet 1. How
do I get the button in Sheet 1 to point at some functions in
ThisWorkbook?

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
Missing buttons for Quick Access Bar kerry Excel Discussion (Misc queries) 0 September 18th 08 01:38 PM
make custom buttons for macros on quick access bar excel 2007 shieber Excel Discussion (Misc queries) 0 April 28th 08 12:45 PM
make buttons bigger on quick access toolbar Techtrainer Excel Discussion (Misc queries) 1 January 18th 08 12:23 AM
DP adjustment using quick menu buttons when sheet protected Aaron Excel Worksheet Functions 0 April 12th 07 02:05 AM
Quick question - quick answer about assigning shortcut keys funkymonkUK[_75_] Excel Programming 1 October 13th 05 10:50 AM


All times are GMT +1. The time now is 12:42 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"