+ Reply to Thread
Results 1 to 4 of 4

Option Button LinkedCell using VBA - will not reference different sheet

  1. #1
    Registered User
    Join Date
    12-09-2015
    Location
    California
    MS-Off Ver
    2010
    Posts
    19

    Question Option Button LinkedCell using VBA - will not reference different sheet

    Hello -
    I have created a functional spreadsheet with a lot of floating option buttons that are grouped in numerous different groups. I have suffered the wrath of the Excel bug that moves objects around when the resolution of the screen changes so I have created a code that moves all of my option buttons back in place upon Open. The problem I found with this was that when the option buttons are moved, they lose their LinkedCell designation, which is necessary to maintain the function of the sheet. So I am trying to write a macro that re-assigns the Linked Cells upon start-up to each option button. I have a list on sheet "ObjPos" with each option button name with the desired LinkedCell location typed as text (ie Sheets!$B$2) two cells over from each entry. I wrote the following code but I can't figure out why the cell won't link. Please help! Thanks



    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Option Button LinkedCell using VBA - will not reference different sheet

    Without a worksheet reference Range(LinkLocale) will refer to a cell/range on the active worksheet.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Option Button LinkedCell using VBA - will not reference different sheet

    The Linked cell should be defined as text and not a Range object


    OptBut.LinkedCell = LinkLocale
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    12-09-2015
    Location
    California
    MS-Off Ver
    2010
    Posts
    19

    Re: Option Button LinkedCell using VBA - will not reference different sheet

    Thanks AlphaFrog. That did the trick. Sometimes it's the easiest fix that gets overlooked. Also thanks Norie for the reply.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Fill a listbox from a non active sheet with option button
    By molesy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2014, 07:44 AM
  2. [SOLVED] Reference Option Button name in a variable in IF Statement
    By diane.perry in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-04-2014, 07:27 PM
  3. [SOLVED] Sort sheet when option button selected
    By Macfool in forum Excel General
    Replies: 6
    Last Post: 01-28-2014, 01:08 PM
  4. ActiveX Spin Button LinkedCell Question
    By speed007 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-21-2014, 08:08 PM
  5. [SOLVED] Textbox Deletes LinkedCell Reference
    By sandz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-27-2012, 04:15 PM
  6. [SOLVED] Option Button on sheet changes size in 1024 by 768 resolution
    By Michael Tress in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2006, 05:10 PM
  7. [SOLVED] Combo Box "LinkedCell" option
    By Patty via OfficeKB.com in forum Excel General
    Replies: 0
    Last Post: 08-02-2005, 05:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1