Excel Drop Down List - Jump to Corresponding Cell

sparkytech

Board Regular
Joined
Mar 6, 2018
Messages
96
Office Version
  1. 365
  2. 2019
I need a drop-down list that is populated from column "A", which only looks at the first row of each "section", and then allows the user to click the selected name in the drop-down box, and then the cursor will move to that cell containing the name selected. The way I currently do this, is a helper column "B" with a formula only in the rows with {Project Name}. For example, A12 contains {Project Name} and B12 contains the formula "=A12". Cells B13 through B19 are blank, and B20 contains "=A20", etc. This was my "easy" way to ignore everything in column A other than the project name and create a list for my drop-down. Is there a way to allow the user to select the project listed in the drop-down list and have the cursor jump to the cell with that project name? So, if the user clicks "Project A" in the drop-down, the cursor moves to cell A12? The project list will change often, so I need the links in the drop-down to happen automatically. I'm not opposed to VBA, but would prefer to avoid it if possible in order to future proof the sheet from company policies at a later date. Thanks in advance!

Screenshot 2023-07-12 162032.jpg
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
A couple of suggestions. Firstly, with regard to the data validation. I note that your profile says you have 365, therefore you should be able to access Unique/Filter functions. The data validation demonstrated below uses such a combination and has 2 advantages over your current method: 1) it will automatically adjust as you add more Projects to column A. I made the formula look down as far as row 100, but you can change that to however many rows that you think you’ll need. 2) your data validation list is free from blanks.

sparkytech.xlsm
ABC
1
2
3Select Project
4Project CProject A
5Project B
6Project C
7
8
9
10
11
12Project A
13ID1
14Current Status:
15
16
17
18
19
20Project B
21ID1
22Current Status:
23
24
25
26
27
28Project C
29ID1
30Current Status:
31
32
33
34
35
Sheet1
Cell Formulas
RangeFormula
C4:C6C4=UNIQUE(FILTER(A12:A100,(A12:A100<>"")*(LEFT(A12:A100,7)="Project")))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
A4List=$C$4#


Secondly, there is no such function/formula that will move the focus of the active cell, you’ll need VBA for that. The following worksheet change event code will do what you want. If you’re not sure where to put it – right click on the tab name & select “View Code”. Paste the code in the window that appears to the right of the screen. As before you can change the row reference from 100 to whatever you think you’ll need. I’ve also indicated a line of code that scrolls the window down to the Project selected in the dropdown – you can delete that line if that’s not what you wanted.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Cells.CountLarge = 1 And Not Intersect(Range("A4"), Target) Is Nothing Then
        Application.EnableEvents = False
        Dim r As Range, s As String
        s = Range("A4")
        Set r = Range("A5:A100").Find(s, , xlFormulas, xlWhole, xlByRows, xlNext, False)
        If Not r Is Nothing Then
            r.Select
            ActiveWindow.ScrollRow = Selection.Row  '<~~ Remove this if you prefer
        End If
        Application.EnableEvents = True
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,076
Messages
6,122,984
Members
449,092
Latest member
Mr Hughes

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