Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Make option button link permanent to cell

With the help of Trevor Williams on this board I was able to easily link
hundred of group boxes (with 4 radio buttons in each) to the cell that they
were on top of. Here is the code:

Sub LinkOptBtns()
Dim GrpBox As GroupBox
Dim OptBtn As OptionButton
For Each OptBtn In ActiveSheet.OptionButtons
With OptBtn
.LinkedCell = .GroupBox.TopLeftCell.Address
End With
Next
End Sub


My problem is that I am starting to lose the links and I am finding myself
running the code randomly to re-link them. Can someone help me make the
control links permanent? I want to distribute my workbook to many users and
will not allow them to access to the VBA.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Make option button link permanent to cell


I'm not sure (and I'm not able to test this just now) but the problem
may be that the linked cell is being assigned as an absolute reference
and any row or column insertions or deletions you are making may be
causing problems.

To test this, you can try making the following change:

LinkedCell = .GroupBox.TopLeftCell.Address(0,0)

This change will give instead of an absolute reference ($R$4) a
relative one (R4) - which might work better - or maybe not :(

Good luck with this!


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=121855

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Make option button link permanent to cell

Thanks, James. I tried adding a row here and there within the worksheet and
it didn't appear to break the links. It seems to be happening randomly.
Perhaps you are partially right--I might be making changes somewhere that is
affecting the linked cells. I'm thinking that I should run the linking macro
last when I know I am not making any more changes to the workbook.

Wish I had a better way to test this...those radio buttons are my main
source of input for the workbook. Appreciate the help!

"jamescox" wrote:


I'm not sure (and I'm not able to test this just now) but the problem
may be that the linked cell is being assigned as an absolute reference
and any row or column insertions or deletions you are making may be
causing problems.

To test this, you can try making the following change:

.LinkedCell = .GroupBox.TopLeftCell.Address(0,0)

This change will give instead of an absolute reference ($R$4) a
relative one (R4) - which might work better - or maybe not :(

Good luck with this!


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=121855


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
Option Button - Cell Link Issue John Jost Excel Programming 3 January 12th 06 09:58 PM
Second option button disappears when I make another column Monique Excel Worksheet Functions 0 March 9th 05 09:57 PM
Option Button-Format Control-Cell Link... andym Excel Programming 7 October 5th 04 01:49 PM
Control Cell Link for Option Button based on value in a cell arunjoshi[_14_] Excel Programming 1 May 5th 04 02:19 AM
Control Cell Link for Option Button based on value in a cell arunjoshi[_13_] Excel Programming 0 May 4th 04 05:46 AM


All times are GMT +1. The time now is 04:49 PM.

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"