Data validation dropdown with Hyperlink

snake93

New Member
Joined
Oct 31, 2020
Messages
7
Office Version
  1. 2019
Platform
  1. Windows
Hi guys.

I found this video explaining how to create a dropdown menu with data validation. It is exactly what I was looking for, however, I was wondering if it was possible to add links in the dropdown menu.

Can someone help me ?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Do you want clicking on dropdown item to behave like clicking on a hyperlink?
 
Upvote 0
data validation in cell A2 in Sheet1
dv LIST.jpg


list and links in Sheet2
dv LINKS.jpg



Place this code in Sheet1 window (NOT in module like Module 1)
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address(0, 0) = "A2" Then
        On Error Resume Next
        Sheets("Sheet2").Range("A:A").Find(Target).Offset(, 1).Hyperlinks(1).Follow
        On Error GoTo 0
    End If
End Sub


Or do you want it to behave differently?
 
Last edited:
Upvote 0
Thanks for your time, I really appreciate it.
It is exactly what I was looking for, but I have questions.

1. What is the VBA code for?

2. The dropdown menu in sheet1 also works without code. The function I was looking for is Option 1, Option 2 etc ... they must be hyperlinked based on sheet2's list.

3. I have a sheet downloaded from the internet with this feature, but I can't understand how it works.

I'm attaching it as an example: just that in the example file, I don't need 3 columns, just two, and when I delete a column nothing works.

Dropdown Hyperlinked List
 
Upvote 0
Sorry - I never download files
XL2BB is a site tool available to upload samle data to the thread
 
Upvote 0
Sorry, I didn't think MrExcel's policy was to not download files. Anyway, I was able to get the desired function thanks to combobox and some VBA code. This was possible thanks to a user of another forum; here is the solution.

Although I solved the problem I am interested in replicating the function with data validation, here is the sheet generated with xl2bb as suggested.

Dropdoen Hyperlinked List.xlsm
AB
1Exercise
2Squat
3Bench
4Deadlift
Scheda (Sheet1)
Cells with Data Validation
CellAllowCriteria
B2:B4List=INDIRECT(exercise)
A1:A4List=city2

-
Dropdoen Hyperlinked List.xlsm
AB
1ExerciseLink
2Squathttps://www.youtube.com/watch?v=J_ekvFybels, https://www.youtube.com/watch?v=J_ekvFybels
3Benchhttps://www.youtube.com/watch?v=w0XBfuCC2WM&t=503s, https://www.youtube.com/watch?v=w0XBfuCC2WM&t=503s
4Deadlifthttps://www.youtube.com/watch?v=LGIS9vs65Sk&t=92s, https://www.youtube.com/watch?v=LGIS9vs65Sk&t=92s
DBS (Sheet2)
 

Attachments

  • codevba1.PNG
    codevba1.PNG
    26.9 KB · Views: 3
  • codevba2.PNG
    codevba2.PNG
    40.5 KB · Views: 2
Upvote 0
Glad you have a solution. Thanks for posting link to it so that others may benefit.
Good luck
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,387
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top