#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Marco Help

Hello
I have a text box with an assigned macro. I want th run two macros off of
the button. Which macro runs will depend on the location of the active cell.
User will have two options. If cell A1 active, button will run macro a. If
cell B1 active, button will run macro b.

Tank you
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 695
Default Marco Help

assign ur button to macro "Butt"

Sub Butt()
If ActiveCell.Address = "$A$1" Then Call a
If ActiveCell.Address = "$B$1" Then Call b
End Sub

Sub a()
MsgBox ("") & ActiveCell.Address
End Sub

Sub b()
MsgBox ("") & ActiveCell.Address
End Sub


"looper" skrev:

Hello
I have a text box with an assigned macro. I want th run two macros off of
the button. Which macro runs will depend on the location of the active cell.
User will have two options. If cell A1 active, button will run macro a. If
cell B1 active, button will run macro b.

Tank you

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 903
Default Marco Help

Would suggest instead using an Event Macro, specifically a
double-click macro, and test the target address, column, or row.
http://www.mvps.org/dmcritchie/excel/event.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"looper" wrote in message ...
Hello
I have a text box with an assigned macro. I want th run two macros off of
the button. Which macro runs will depend on the location of the active cell.
User will have two options. If cell A1 active, button will run macro a. If
cell B1 active, button will run macro b.

Tank you



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
Writing a Marco Joey Excel Discussion (Misc queries) 0 August 8th 05 08:10 PM
I need some help with a Marco xgunda420x Excel Discussion (Misc queries) 2 August 2nd 05 01:43 PM
how to use marco in excel rnparikh New Users to Excel 9 August 2nd 05 12:08 AM
Exporting a Marco Lance Gray Excel Discussion (Misc queries) 1 January 5th 05 08:52 PM
Marco Loi New Users to Excel 4 December 7th 04 08:52 PM


All times are GMT +1. The time now is 05:11 PM.

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

About Us

"It's about Microsoft Excel"