Move cursor to first name starting with a specific letter

Canoer

New Member
Joined
Aug 4, 2023
Messages
2
Office Version
  1. 2013
Platform
  1. Windows
I have column A with 50 first names, alphabetized from A to Z. I want to be able to move my cursor to the first name in the list that begins with a specific letter.
For example: Adam, Adrian, Brian, Butch, Bob, Charlie, Chip, Chester, Dale, David. I want to move the cursor down the list until I come to the first name beginning with the letter "C", Charlie. When using "Find" in the quick access toolbar, the cursor stops at "Butch" because of the "c" in the name. I would like to have a macro so that I can select or input a letter and have the cursor move to the first name in the list beginning with that letter.

Any help or suggestions appreciated.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Welcome to the MrExcel board!

What about just using this in the 'Find' dialog?

1691193120572.png
 
Upvote 0
1691194933376.png


Code for the button
VBA Code:
Sub MoveCursor_Click()
'
' MoveCursor_Click Macro
'
  Dim rng As Range
'
    Set rng = Range("A:A").Find(Range("B2"), , , xlPart)
    
'    Set rng = Cells(WorksheetFunction.VLookup(Range("B2"), Range("A:A"), 0, False), 1)
    rng.Select
    rng.Activate
    
End Sub
 
Upvote 0
Code for the button
Not sure if or how well you tested that code. It selects Alice for me.
Also not sure why rng.Activateis included? Selecting the cell already does that.

@Canoer
It you did want a search cell/button like that, I think all you should need is this
VBA Code:
Sub MoveCursor_Click()
  On Error Resume Next
  Columns("A").Find(What:=Range("B2").Value & "*", LookAt:=xlWhole).Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,093
Messages
6,123,068
Members
449,091
Latest member
remmuS24

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