View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tony Zappal Tony Zappal is offline
external usenet poster
 
Posts: 21
Default searching for a value...

Hi All,

I have the below coding attached to userform1. Everytime combobox1
changes(selecting supplier name), it queries the sheet Suppliers, and returns
back the corresponding supplier number if it's available.
In the Supplier sheet, Column A is the supplier name and Column B is the
supplier number.
Now, what i also need to do, is at the same time, but on a different sheet
(RecData), is bring in two fields of data into variables.
On the RecData sheet, Column A = Supplier name, Col B = supplier number, Col
C = Last reconciliation date, and Col D = priority number.
RecData doesn't contain the same amount of suppliers as in thte supplier
sheet, therefore i cant use the ListIndex from the combobox.

Is there another way i can bring in these two variables? Im not sure on what
the best type find/search i can use.

Cheers,
Tony.
---------------------------------------
Private Sub ComboBox1_Change()
Dim r As Range
Dim s As Range
Dim t As Range
With Sheets("Suppliers")
On Error Resume Next
Set r = .Range("A1")(UserForm1.ComboBox1.ListIndex + 1, 2)
If Err.Number = 1004 Then
Label3.Caption = "N/A"
End If
Label3.Caption = r
strSuppNum = r
End With

'With Sheets("RecData")

'This is where i can't figure out what to do...

' strRecLstCom = s
' strSuppPriNum = t
'End With

End Sub