Probelm with a VBA Index Match Function

TonySondergeld

New Member
Joined
Jul 11, 2009
Messages
31
The Code I trying to get to work below come up with a error (Unable to get the MATCH property of the worksheet Function class. How it is to work when the combobox value is changed it lookup the value in a worksheet rang:F4:F1500 and when found return the matching row cell in column H4:H1500.
Any help would be great thanks you
Private Sub CBX_BagNo_Change()
Dim i
Dim iRange As Range, xRange As Range
Set iRange = Sheets("Bag Info Data").Range("F4:F1500")
Set xRange = Sheets("Bag Info Data").Range("H4:H1500")
i = CBX_BagNo.Value
Sheets("Print Bag Flags").TBX_ManufactureDate.Value = ""
Sheets("Print Bag Flags").TBX_ManufactureDate.Value = Application.WorksheetFunction.Index(iRange, Application.WorksheetFunction.Match(i, x, 0), 1)
End Sub
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Should the x in the line below not be xRange ?


Code:
Sheets("Print Bag Flags").TBX_ManufactureDate.Value = Application.WorksheetFunction.Index(iRange, Application.WorksheetFunction.Match(i, [B][COLOR="#FF0000"]x[/COLOR][/B], 0), 1)
 
Upvote 0

Forum statistics

Threads
1,222,833
Messages
6,168,523
Members
452,194
Latest member
Lowie27

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top