Drop down list with hyperlinks...

  • Thread starter Thread starter jtho13
  • Start date Start date
J

jtho13

I have created a drop down list but I would like to make each data in
the list have a hyperlink within the same workbook.

Can this be done? If so any advice would be greatly appreciated.

Joseph
 
Hello Joseph,

Add a module to your project and copy the following macro code into it.
Put the hyperlinks into the Drop Down's List Range and assign the macro
to the Drop Down. When you select a item in the Drop Down, the
hyperlink will be activated.

Sub GoToHyperlink()

Dim DropDownName
Dim LinkName

On Error GoTo NoLink

DropDownName = Application.Caller

With ActiveSheet.Shapes(DropDownName).ControlFormat
LinkName = .List(.ListIndex)
End With

ActiveSheet.Hyperlinks(LinkName).Follow

Exit Sub

NoLink:
MsgBox "Hyperlink " & LinkName & " not found.", vbExclamation

End Sub

Sincerely,
Leith Ross
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top