Drop Down Menu Help!

digbeefeebee

New Member
Joined
Jan 8, 2019
Messages
4
Hello,

I am sure this is a quick fix but for the life me I can't work it out!
I am creating a planner with all months going along Row 1.
I want to create a drop down so when I select e.g. March it will take me to the month March on my spreadsheet.

It is going to be a rather long spreadsheet so was looking for a nicer look to navigate around rather than hyperlinking.

Could anyone help me?

Thank you so much!

Jodie
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Selecting March from dropdown in A1 takes user to D1

Place this code in the SHEET module
RightClick on sheet tab \ select ViewCode \ paste code into VBA editor \ back to Excel with {ALT}{F11}
Save workbook as macro-enabled

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address(0, 0) = "A1" Then Application.Goto (Rows(1).Find(Target))
End Sub

With worksheet looking like this

Excel 2016 (Windows) 32 bit
[Table="width:, class:head"][tr=bgcolor:#E0E0F0][th] [/th][th]
A
[/th][th]
B
[/th][th]
C
[/th][th]
D
[/th][th]
E
[/th][/tr]
[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
1
[/td][td=bgcolor:#FFFF00]March[/td][td]January[/td][td]February[/td][td]March[/td][td]April[/td][/tr]
[/table]
[Table="width:, class:grid"][tr][td]Sheet: Sheet2[/td][/tr][/table]
 
Last edited:
Upvote 0
Thank you, this worked however, I am noticing when I do this it removed my data validation after I select e.g. March from the drop down? Any Thoughts on this.
 
Upvote 0
Thank you, this worked however, I am noticing when I do this it removed my data validation after I select e.g. March from the drop down? Any Thoughts on this.

There is nothing in that code that would remove the data validation...Do you have any other code that might be removing the DV ?
 
Upvote 0
No, I am using no further code - I don't work with code a lot so very rarely use it.

When I use it once it disappears and I can't make a further selection, but I can type the cell the month and it will take me to the cell containing it. Just removes the 'drop down'. However, when I close the spreadsheet down and reopen it will appear again. :confused:
 
Upvote 0
As @Jaafar Tribak says there is nothing in the code to change data validation in cell A1 in any way

Similar code for you to try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address(0, 0) = "A1" Then Rows(1).Find(Target).Activate
End Sub

If you are still having problems try a creating new workbook and test to see if it also happens there
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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