ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Locked Cells and Hyperlinks (https://www.excelbanter.com/excel-programming/422455-locked-cells-hyperlinks.html)

Martin

Locked Cells and Hyperlinks
 
Hello,

I hope someone can help with a problem I am encountering.

I have a workbook with 4 sheets and for each sheet I want to protect the
cells and not allow users to select the locked cells but allow them to select
unlock cells.

I also have hyperlinks on each sheet. When I envoke the locked cells /
protection whenever I select anywhere in the sheet, the hyperlink action
takes place. Its not necessarily the first hyperlink either, it seems to
chose a randon hyperlink everytime I unprotect and re-protect.


I do have this code in the Worksheet_FollowHyperlink sub, does that make a
difference?

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

If ActiveCell.Address = "$J$10" Then Call ShowUsers
If ActiveCell.Address = "$L$18" Then Call Quit

End Sub

Can anyone advise on how I can overcome this?

Many thanks in advance.

Martin

John

Locked Cells and Hyperlinks
 
no sure if this will help but whenever I place a hyperlink on a sheet I
assign it to an autoshape from the drawing toolbar rather than directly in a
cell.
--
jb


"Martin" wrote:

Hello,

I hope someone can help with a problem I am encountering.

I have a workbook with 4 sheets and for each sheet I want to protect the
cells and not allow users to select the locked cells but allow them to select
unlock cells.

I also have hyperlinks on each sheet. When I envoke the locked cells /
protection whenever I select anywhere in the sheet, the hyperlink action
takes place. Its not necessarily the first hyperlink either, it seems to
chose a randon hyperlink everytime I unprotect and re-protect.


I do have this code in the Worksheet_FollowHyperlink sub, does that make a
difference?

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

If ActiveCell.Address = "$J$10" Then Call ShowUsers
If ActiveCell.Address = "$L$18" Then Call Quit

End Sub

Can anyone advise on how I can overcome this?

Many thanks in advance.

Martin



All times are GMT +1. The time now is 05:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com