Hi,
I have some code that compares entries in an Excel SS with entries in an Access DB.
The following code basically works - if a match is found, I get a range in "skuFound".
I can pull out the DB value from "newProdRecords" but I'm having trouble figuring out
how to extract the matched filteredTable value.
Finally, how can I index to other columns in the SS for the matched value row in order to extract
other values?
Thanks for any help provided.
I have some code that compares entries in an Excel SS with entries in an Access DB.
The following code basically works - if a match is found, I get a range in "skuFound".
I can pull out the DB value from "newProdRecords" but I'm having trouble figuring out
how to extract the matched filteredTable value.
Finally, how can I index to other columns in the SS for the matched value row in order to extract
other values?
Thanks for any help provided.
Code:
Set gpsyWs = WB.Gpsy.Worksheets("Gpsy_Rpt")
gpsyWs.Activate
Set wsRange = gpsyWs.Range(Cells(2, 1), Cells(LastRow(gpsyWs, "A"), 1))
Set filteredTable = CreateTable(tableWS:=gpsyWs, dataRange:=wsRange)
Set filteredTable = CreateTable(fn:="Filter", tableWS:=gpsyWs, dataRange:=wsRange, field1:=1, critr1:="J*")
For dbCounter = 1 To newProdRecords.RecordCount
Set skuFound = filteredTable.rows.Find(What:=newProdRecords.Fields("Product_ID").Value, LookIn:=xlValues, LookAt:=xlWhole)
If Not skuFound Is Nothing Then 'got a match!
MsgBox" SKU in DB is: " & newProdRecords.Fields("Product_ID").Values '<==OK, gives correct value
MsgBox" Matching SKU in GPSy is: " & filteredTable.rows.Range(skuFound).Value '<== Doesn't work!!!
End If
newProdRecords.MoveNext
Next dbCounter