Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default button awareness. i dont know if it can be done.


can you make a macro assigned to button aware of where that button is?

i want to use the same macro for all 250+ buttons i will hav
associated to the row its placed on.....so i need the macro to be awar
of what button triggered the macro and not to repeat the macro for al
buttons.

on top of that....i need the macro to beable to know where the butto
is.....on what column and what row....if you need my code o
spreadsheet i can post it....thanx

--
cdd
-----------------------------------------------------------------------
cdde's Profile: http://www.excelforum.com/member.php...fo&userid=1553
View this thread: http://www.excelforum.com/showthread.php?threadid=27139

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default button awareness. i dont know if it can be done.

That is a bunch of buttons dude! And all buttons will run the same macro? Is
that all the buttons will do? If so, there must be a simpler way to do what
you want. Please post what data is in your sheet and what you want to do
with it, and any code you have.

Thnx..Mike F
"cdde" wrote in message
...

can you make a macro assigned to button aware of where that button is?

i want to use the same macro for all 250+ buttons i will have
associated to the row its placed on.....so i need the macro to be aware
of what button triggered the macro and not to repeat the macro for all
buttons.

on top of that....i need the macro to beable to know where the button
is.....on what column and what row....if you need my code of
spreadsheet i can post it....thanx.


--
cdde
------------------------------------------------------------------------
cdde's Profile:

http://www.excelforum.com/member.php...o&userid=15532
View this thread: http://www.excelforum.com/showthread...hreadid=271393



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default button awareness. i dont know if it can be done.


Try something like this! (put this in your auto_open module)

With Application
.CommandBars("name of your commandbar").Controls("name of you
button").OnAction = "name of your macro"
End With

Hope this helps

Simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=27139

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default button awareness. i dont know if it can be done.

Look at "application.caller" then use that value to find the button
(use buttons from the forms collection, not the control toolbox)

Sub FindMe()

Dim sName
Dim s

sName = Application.Caller
Set s = ActiveSheet.DrawingObjects(sName)
MsgBox s.TopLeftCell.Address(False, False)

End Sub

Tim


"cdde" wrote in message
...

can you make a macro assigned to button aware of where that button
is?

i want to use the same macro for all 250+ buttons i will have
associated to the row its placed on.....so i need the macro to be
aware
of what button triggered the macro and not to repeat the macro for
all
buttons.

on top of that....i need the macro to beable to know where the
button
is.....on what column and what row....if you need my code of
spreadsheet i can post it....thanx.


--
cdde
------------------------------------------------------------------------
cdde's Profile:
http://www.excelforum.com/member.php...o&userid=15532
View this thread:
http://www.excelforum.com/showthread...hreadid=271393



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
Dont want #DIV/0!. Wanna Learn Excel Worksheet Functions 3 January 3rd 08 03:14 PM
Dont know if this is possible to do pinmaster Excel Discussion (Misc queries) 0 February 3rd 06 11:21 AM
I know what I need but dont know how to do it solar_eclipse2 Excel Worksheet Functions 5 June 6th 05 01:44 AM
Imitating Pivot table's context awareness R Avery Excel Programming 3 September 17th 04 05:19 PM
Dont know how? Krefty[_3_] Excel Programming 1 December 15th 03 10:43 AM


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