Using form entries to locate a table row

arcrazr

New Member
Joined
May 7, 2020
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am trying to located a row in a table [turnoverdata] using entries from a userform (Update). The three columns together should provide a key that will isolate the entry to one row only. (This code should be able to aide that function as well when creating the table entry in the first place in my imagination). The values of the three userform comboboxes are set using code and values from the table so, only entries that already exist should be able to be searched.

So far the best I could come up with is below. I compile okay but get an error that 'object doesn't support this property or method' I have tried setting 'row' as a range, listobject, long. same result

Any help would be appreciated.

VBA Code:
Private Sub find_Row()
Dim row As Long
row = [TurnoverData].Index([TurnoverData], [TurnoverData].Match(CDate(Me.CBODateUpdate.Value), [turnoverdata[TBdate]], 0), [TurnoverData].Match(Me _
.CBOLineupdate.Value, [turnoverdata[CBOLine]], 0), [TurnoverData].Match(Me.CBOShiftUpdate.Value, [turnoverdata[FRMShift]], 0)).row
Print row

End Sub
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Try this

VBA Code:
Private Sub find_Row_Click()
  Dim nRow As Long
  nRow = Evaluate("SUMPRODUCT((TurnoverData[Tbdate]=DATEVALUE(""" & Format(CDate(CBODateUpdate), "mm/dd/yyyy") & """))*" & _
                             "(TurnoverData[CBOLine]=""" & CBOLineupdate & """)*" & _
                             "(TurnoverData[FRMShift]=""" & CBOShiftUpdate & """)*ROW(TurnoverData[Name]))")
End Sub
 
Upvote 0
Also check this option:

VBA Code:
Private Sub find_Row_Click()
  Dim nRow As Variant
  nRow = Evaluate("=MATCH(DATEVALUE(""" & Format(CDate(CBODateUpdate), "mm/dd/yyyy") & """)&""|" & CBOLineupdate & "|" & CBOShiftUpdate & """," & _
                   "TurnoverData[Tbdate]&""|""&TurnoverData[CBOLine]&""|""&TurnoverData[FRMShift],0)")
End Sub
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,716
Members
448,985
Latest member
chocbudda

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