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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Initialize Hyperlink (CTRL+K) when user selects cell..

Status
Not open for further replies.

basepointdesignz

Programmer
Joined
Jul 23, 2002
Messages
566
Location
GB
Hi,

Can anyone clear up this probably very easy problem?

What I want to do is very straight forward. I have a particular cell on an order worksheet, which will contain a hyperlink to another file. All I want to do is when the user selects the cell the Hyperlink (CRTL+K) command is initiated - only to the part where the dialog box opens. This is so the user can select the file themselves..

Any ideas? I pressume it'll need an IF statement to get the correct cell but I don't know the syntax or code..

Cheers,

Renegade..

BULLET-PROOF DESiGNZ
renegade@tiscali.co.uk
 
On the worksheet code page for the sheet you want to have this behavior, put:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.Dialogs(xlDialogInsertHyperlink).Show
End Sub

Rob
[flowerface]
 
Thanks Rob,

That works fine but for all cells.. How do I set up the IF statement so that the dialog box appears only if say cell "B6" was selected?

Cheers,

Renegade.. BULLET-PROOF DESiGNZ
renegade@tiscali.co.uk
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
if target.address="$B$6" then
Application.Dialogs(xlDialogInsertHyperlink).Show
end if
End Sub

Rob
[flowerface]
 
Thanks Rob,

That all works brilliantly. Thanks for the speedy response.

Cheers,

Renegade.. BULLET-PROOF DESiGNZ
renegade@tiscali.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top