LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Have one Macro react to whatever cantrol calls it

Hello,
I had a user ask me if there was a way to create a custom checkbox control
for use in Excel. Dick Kusleika was kind enough to suggest this macro and
it worked with great success.

Sub CheckCircle()

With Sheet1.Shapes(1).TextFrame
If .Characters.Text = Chr$(252) Then
.Characters.Text = ""
Else
.Characters.Text = Chr$(252)
End If
End With

End Sub

The user was very happy and with him not knowing anything about VBA, he
asked if I could modify a spreadsheet for him. Not thinking, I accepted.
Turns out it is actually three specification spreadsheets that each have a
minimum of 100 of such custom checkbox controls.

You can see that this would be beyond tedious to have to make a macro for
each control in the above fashion.

Is there a way to make this ONE macro respond to which ever custom control
that calls it? How can you interrogate what control called the macro?
something like:

iCallingControl=CallingControl(item)
Sheet1.Shapes(iCallingControl).TextFrame

Sad I know but does my problem make sense? Is there a spiffy solution?

Any help would be appreciated.

Jim




 
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
Non-blocking calls to Excel Macro using OLE Automation BW Excel Programming 5 August 3rd 05 09:13 PM
Attn: Dave P. Question re Pix Calls via Macro DocuMike Excel Discussion (Misc queries) 1 January 10th 05 01:38 AM
one macro calls the other ebony Excel Programming 1 January 7th 04 05:27 AM
Macro Calls lchhat Excel Programming 5 November 14th 03 03:56 PM
"This macro calls that macro, which calls .."-how many? Ed[_9_] Excel Programming 2 November 3rd 03 10:02 PM


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