use text box instead of list box in a userform

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
622
Office Version
  1. 365
Platform
  1. Windows
Hi

I’m using a list box in a userform that has the Letters A to Z
When the user wants to look up a word, he/she clicks on the letter and the box closes and the cursor goes to that range
Example: if A is picked, the cursor goes to A_A
If B is picked, the cursor goes to B_B
VBA Code:
Private Sub CommandButton1_Click()
Sheets("Sheet1").Select
Select Case Me.ListBox1.Value
Case Is = "A": Application.Goto Reference:="A_A", Scroll:=True
Case Is = "B": Application.Goto Reference:="B_B", Scroll:=True

I am wondering if I could have a Text Box and the user would then just enter a letter.
If it can be done, what would the code be??

If I used something like this
VBA Code:
With TextBox1 ActiveSheet.Range("ae3").Value = .Text
End With

How would I have a macro run base on a cell entry if the text box puts the letter in a cell on the sheet



mike
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
622
Office Version
  1. 365
Platform
  1. Windows
Thanks Fluff
Yo make it soooooooooooooooooo easy

mike
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,964
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,291
Messages
5,641,373
Members
417,206
Latest member
sam89665

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
Top