Code for jump to specific cell

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,199
Office Version
  1. 2007
Platform
  1. Windows
Morning all,

How would this be possible please.
I have a worksheet where in column B is the customers name.
The first cell is B8 and continues down the page for however long.

My request would be to jump to a specific first letter of there christian name.
Not sure how it would work but lets say a drop down list of which has the letters of the alphabet A-Z
If i select letter S then i would be taken to the first cell for where the names with S start.

Thanks.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi,
That would be ok if i knew the customers full name.
I thought by just selecting say S then once taken to first cell i could then manually use my down arrow etc.

Thanks
 
Upvote 0
Well the idea of this is that if you type "S" you get names with "S" in if you then type "M" getting "SM" you will get only names with "SM" in and so on. You can go back and forth to get the name. Then when you see the name below , click on it and it will take yo to that name.
 
Upvote 0
This is the main module code

Code:
Option Explicit


Public A2LArr1
Public A2LArrFilter
Public LastRowNo As Long
Public Tbox1Active As Boolean


Sub PrimeList()
LastRowNo = Worksheets("Sheet1").Range("G65536").End(xlUp).Row 'Just to set list of names
A2LArr1 = Application.Transpose(Worksheets("Sheet1").Range("G1:G" & LastRowNo).Value)
Worksheets("Sheet1").LBox_Add.List = A2LArr1
'clear filter text box
'stop the update for the listbox
Tbox1Active = False
Worksheets("Sheet1").TBox_Add.Text = ""
'start the update for the listbox
Tbox1Active = True
'reset index of listbox
Worksheets("Sheet1").LBox_Add.ListIndex = -1
End Sub

Code from the sheet with the Textbox (called "TBox_Add") and Listbox (called "LBox_Add")
Code:
'Button only needed if no other code primes the textbox and listbox
Private Sub CButtonPrime_Click()
PrimeList
End Sub


Private Sub LBox_Add_Click()
Dim Ploop  As Long


For Ploop = 1 To LastRowNo
    If Me.LBox_Add.Value = Worksheets("Sheet1").Range("G" & Ploop).Value Then
        Worksheets("Sheet1").Range("G" & Ploop).Select
        Exit For
    End If
Next Ploop


End Sub


Private Sub TBox_Add_Change()
A2LArrFilter = A2LArr1
'Case sensitive
'If Tbox1Active = True Then Me.LBox_Add.List = Filter(A2LArrFilter, Me.TBox_Add.Text)
'Not case sensitive
If Tbox1Active = True Then Me.LBox_Add.List = Filter(A2LArrFilter, Me.TBox_Add.Text, , vbTextCompare)
End Sub

Hope this helps. You can always get the list box to direct you to some code to do something other than just go to the name.
 
Upvote 0

Forum statistics

Threads
1,213,557
Messages
6,114,288
Members
448,563
Latest member
MushtaqAli

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