+ Reply to Thread
Results 1 to 12 of 12

How to make two cells clickable (all other cells are NOT clickable)?

  1. #1
    Forum Contributor
    Join Date
    08-20-2009
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    119

    How to make two cells clickable (all other cells are NOT clickable)?

    Activesheet.Range("B6").Select
    Selection.Locked = False

    Activesheet.Range("B11").Select
    Selection.Locked = False

    Then lock whole worksheet


    ---------------------------------------

    Both B6 and B11 are hyperlinks, so I want people can click the link. But my code can only keep B11 unlocked. In other words, people can only click hyperlink in B11.

    If I remove (Activesheet.Range("B11").Select
    Selection.Locked = False), then people can click the hyperlink in B6.

    How can I keep both B6 and B11 unlock, and people can click either one of the cells?

    How to select multiple cells (not next to each other)?

    Thanks.
    Last edited by niuyuer; 05-16-2016 at 03:04 PM.

  2. #2
    Forum Contributor
    Join Date
    08-20-2009
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: How to unlock two cells (not next to each other)?

    Activesheet.Range("B6", "B11").Select
    Selection.Locked = False

    This does not work either, it can only keep B6 unlocked.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: How to unlock two cells (not next to each other)?

    I have just tested, and HL works on locked cells, so it looks like you dont even need to do what you are trying?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to unlock two cells (not next to each other)?

    How to select multiple cells (not next to each other)?
    Please Login or Register  to view this content.
    But there's no need to select cells to operate on them.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Contributor
    Join Date
    08-20-2009
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: How to unlock two cells (not next to each other)?

    Quote Originally Posted by FDibbins View Post
    I have just tested, and HL works on locked cells, so it looks like you dont even need to do what you are trying?
    Activesheet.Hyperlinks.Add Anchor:=Activesheet.Cells(6, 2), _
    Address:=wkbook.FullName, TextToDisplay:=wkbook.FullName



    Actually, I mean two file links (two separate files in my Drive). I cannot let people to click both links, only one link works.

  6. #6
    Forum Contributor
    Join Date
    08-20-2009
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: How to unlock two cells (not next to each other)?

    Quote Originally Posted by shg View Post
    Please Login or Register  to view this content.
    But there's no need to select cells to operate on them.
    Activesheet.Range("B6, B11").Locked=False

    Without .Select, I got error message 1004 "Unable to set the Locked property of the Range class"
    Last edited by niuyuer; 05-16-2016 at 01:20 PM.

  7. #7
    Forum Contributor
    Join Date
    08-20-2009
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: How to unlock two cells (not next to each other)?

    Activesheet.Range("B6, B11").Select
    Selection.Locked = False


    Neither link is clickable.

  8. #8
    Forum Contributor
    Join Date
    08-20-2009
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: How to unlock two cells (not next to each other)?

    Maybe my question is not related to unlocked two cells. I should ask: how to make multiple hyperlinks clickable in a protected sheet.

  9. #9
    Forum Contributor
    Join Date
    08-20-2009
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: How to unlock two cells (not next to each other)?

    Anyone know how to make two file links clickable, while all other cells are protected?

  10. #10
    Forum Contributor
    Join Date
    08-20-2009
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: How to unlock two cells (not next to each other)?

    What I want is: only two cells are clickable, all other cells are NOT clickable.

    Please Login or Register  to view this content.
    Last edited by niuyuer; 05-16-2016 at 02:52 PM.

  11. #11
    Forum Contributor
    Join Date
    08-20-2009
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: How to unlock two cells (not next to each other)?

    Can anyone help me make A9 and A14 clickable, while all other cells are NOT clickable.

    Mine code does not work:

    ThisWorkbook.Sheets("TestSht").Protect Password:="pswd", DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True

  12. #12
    Registered User
    Join Date
    12-22-2015
    Location
    Huntsville, AL
    MS-Off Ver
    2007
    Posts
    92

    Re: How to make two cells clickable (all other cells are NOT clickable)?

    I'm confused. Why not just select the cells in which the hyperlinks reside, go to "format cells">"Protection">uncheck "Locked", then protect the sheet, only leave "select unlocked cells" checked?

    That way the only cells they can click on are the ones that hold the hyperlinks.

    I don't think a macro is necessary here.

+ 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. Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  2. Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  3. Replies: 0
    Last Post: 09-06-2005, 07:05 AM
  4. Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  5. Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  6. Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  8. Replies: 0
    Last Post: 09-05-2005, 10: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