LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Control Cell Link for Option Button based on value in a cell

Sub TestLinks()
If ActiveSheet.Cells(1).Value = "1" Then
ActiveSheet.Shapes("OB No. 1").Select
Selection.LinkedCell = "B1"
Range("A1").Select
ElseIf ActiveSheet.Cells(1).Value = "2" Then
ActiveSheet.Shapes("OB No. 1").Select
Selection.LinkedCell = "B2"
Range("A1").Select
End If
End Sub

Assign this macro to each option button. In my test case,
if I changed the linked cell for one option button (which
I named "OB No. 1"), it changed all of them. For some
reason I had to select the option button object first.
There may be another way to write this by by-passing the
selection process. But this works in the meantime....

Rick

-----Original Message-----
I have two option buttons on a sheet. In cell A1, on the

same sheet,
there is a value which can be either 1 or 2.

Can you help me achieve this? ...

If the value in cell A1 is 1, then the Control Cell Link

for the two
option buttons should become cell B1.

If the value in cell A1 is 2, then the Control Cell Link

for the two
option buttons should become cell B2.


---
Message posted from http://www.ExcelForum.com/

.

 
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
Changing Cell Link on Spin Button Form Control Adam Ronalds Excel Discussion (Misc queries) 14 August 27th 09 05:52 PM
Cell Paste using cell link option Half works MardiT Excel Worksheet Functions 4 July 28th 08 06:51 PM
Cell working as a button? Cell color control Emerogork via OfficeKB.com Excel Worksheet Functions 1 August 30th 07 05:20 PM
Control Cell Link for Option Button based on value in a cell arunjoshi[_13_] Excel Programming 0 May 4th 04 05:46 AM
Option Button Control Rod[_4_] Excel Programming 0 September 16th 03 11:30 PM


All times are GMT +1. The time now is 04:25 AM.

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"