PDA

View Full Version : Solved: OLEObject Vlookup help



Emoncada
03-11-2013, 09:42 AM
I have the following Code, that I can't get it to work.

Dim Item As String
Dim UPC As String
Dim sheet As Worksheet
Dim sheet2 As Worksheet

Set sheet = ActiveWorkbook.Sheets("Capture")
Set sheet2 = ActiveWorkbook.Sheets("Catalog")

UPC = sheet.OLEObjects("TxtUPC").Object.Value

Item = Application.WorksheetFunction.VLookup(UPC, sheet2.Range("B2:D400"), 2, False)

sheet.OLEObjects("TxtItem").Object.Value = Item


I am trying to vlookup the data entered into TxtUPC. A Textbox on the Spreadsheet then getting the return value into TxtItem. Another Textbox on the Spreadsheet.

Any help would be great.