ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,683
- Office Version
- 2007
- Platform
- Windows
Hi,
I am using the code as shown.
I populate the Listbox & i then make a selection.
I should then be on the worksheet looking at the customer that i selected from the Listbox but this isnt the case.
Example of whats happening.
The listbox shows 4 customers of which are ABCD
I select A but i am taken C
I then run the code again to populate the Listbox.
I then select A again but taken to D
As you would expect whatever you select you should then be taken to that customer.
Also when the customer is selected on the worksheet it selects the cell in column I but i wish to have it select column A
Do you see what is causing this please
I am using the code as shown.
I populate the Listbox & i then make a selection.
I should then be on the worksheet looking at the customer that i selected from the Listbox but this isnt the case.
Example of whats happening.
The listbox shows 4 customers of which are ABCD
I select A but i am taken C
I then run the code again to populate the Listbox.
I then select A again but taken to D
As you would expect whatever you select you should then be taken to that customer.
Also when the customer is selected on the worksheet it selects the cell in column I but i wish to have it select column A
Do you see what is causing this please
Rich (BB code):
Private Sub ListBox1_Click()
With ThisWorkbook.Worksheets("DATABASE")
Dim data As Variant
data = .Range("I6:I" & .Cells(.Rows.Count, "A").End(xlUp).Row)
End With
Cells.Find(What:=ListBox1.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
Unload ProgrammerForm
answer = MsgBox("OPEN CUSTOMERS FILE IN MAIN DATABASE ?", vbYesNo + vbInformation, "OPEN DATABASE MESSAGE")
If answer = vbYes Then
Database.LoadData Sheets("DATABASE"), Selection.Row
Else
Unload ProgrammerForm
End If
End Sub