ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,224
- Office Version
- 2007
- Platform
- Windows
Evening,
I am using the code shown below.
I have a userform where two columns are populated with data collected from my worksheet.
The code below will allow the user to select an entry in the listbox & be taken to the cell in question at column AB
What i have noticed it that the command button for which the code below is on can be pressed without the user making a selction from the listbox.
It is this i wish to address so that a Magbox pops up to advise say Must make listbox selection first
I am using the code shown below.
I have a userform where two columns are populated with data collected from my worksheet.
The code below will allow the user to select an entry in the listbox & be taken to the cell in question at column AB
What i have noticed it that the command button for which the code below is on can be pressed without the user making a selction from the listbox.
It is this i wish to address so that a Magbox pops up to advise say Must make listbox selection first
Rich (BB code):
Private Sub SelectAndGo_Click()
Range("AB6:AC500").ClearContents
With ThisWorkbook.Worksheets("DATABASE")
Dim data As Variant
data = .Range("J6:J" & .Cells(.Rows.Count, "J").End(xlUp).Row)
End With
Cells.Find(What:=ListBox1.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
Unload HondaKeyCode
End Sub