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: 102
Default Dynamic Button Names?

Hi,

Say you have 3 buttons, each has its sub, and all 3 subs code are
listed in one module.

I want the button names to be read from 3 different cells. So everytime
a cell content change, the name of its related button name change
automatically.

I have the code for the 3 subs as follows:

Sub UnhideSubsystem1()
Range("System").Select
Selection.EntireRow.Hidden = False
End Sub
------------------------------------------
Sub UnhideSubsystem1()
Range("System").Select
Selection.EntireRow.Hidden = False
End Sub
------------------------------------------
Sub UnhideSubsystem1()
Range("System").Select
Selection.EntireRow.Hidden = False
End Sub
------------------------------------------
Now, the sub code for the button name change is:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then _
Me.Buttons(1).Caption = Range("A1").Value
End Sub

My question:
Can I assign a button to 2 subs at the same time? Or, how can I
incorporate the "Private Sub" into each of the other 3 subs, so I end
up with 3 subs?

Thanks,
Mike

 
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
Dynamic Worksheet Names HOOS77 Excel Discussion (Misc queries) 3 September 4th 07 10:24 PM
Dynamic Range Names? RayportingMonkey Excel Worksheet Functions 1 August 31st 07 12:14 AM
dynamic XY chart names [email protected] Excel Discussion (Misc queries) 0 February 9th 07 04:10 PM
Dynamic Worksheet Names Łukasz Czech Links and Linking in Excel 1 August 15th 05 09:41 PM
Dynamic Worksheet Names JClub Excel Worksheet Functions 1 January 10th 05 08:55 PM


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