Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent Typing in Excel 2000

Status
Not open for further replies.

itsmarkdavies

Programmer
May 22, 2001
87
0
0
GB
I have a Worksheet in a Workbook containing Hyperlinks to other Worksheets in the same Workbook.

I want to prevent the Users using the arrow keys on the keyboard to move into the Cells containing Hyperlinks, and then typing over the Hyperlink Text.

I have tried different combinations of Locking / Protecting the area, but it seems to prevent the Usres from actually clicking the Hyperlink aswell, which is obvoiusly no good.

Is there a way in VBA to stop a User typing into a Cell, whilst keeping the Hyperlink in that Cell available for clicking with the mouse ?

I hope this maks sense, and thanks for your help.



mark.davies@npower.com
 
Right click on sheet1 tab , and select view code

end the following

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
      If Target.Address = "$B$2" Then
         Sheet3.Range("B3").Activate
    End If
    

End Sub

where B2 on sheet1 of the workbook contaions a hyperlink, if the user trys to enter their cursor into B2 it shifts the cursor to B2

Chance,

Filmmaker, taken gentleman and He tan e epi tas
 
Thanks Chance, looks good, i`d not come across "Target" before.


mark.davies@npower.com
 
Mark,

Just as an FYI: I was able to lock a hyperlink-containing cell, enable worksheet protection, then select (click) the hyperlink, with the expected action. Not sure why you couldn't. I'm using Excel 2000


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top