Find row with multiple matches

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,422
Office Version
  1. 2016
Platform
  1. Windows
I need to find a way of identify the row number where specific values are found in multiple columns.

The search criteria is on a Userform and is as follows;

Textbox1 - search column A
Textbox2 - search column B
Textbox3 - search column E
TextBox4 - search column F

Once the row is found I need to store the row number as a variable.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try this

Code:
Private Sub CommandButton1_Click()
  Dim wRow As Variant, lr As Long, strg As String
  lr = Range("A" & Rows.Count).End(xlUp).Row
  wRow = Evaluate(Replace("=MAX((A1:A#=""" & TextBox1.Value & """)*(" & _
                                "B1:B#=""" & TextBox2.Value & """)*(" & _
                                "E1:E#=""" & TextBox3.Value & """)*(" & _
                                "F1:F#=""" & TextBox4.Value & """)*(row(A1:A#)))", "#", lr))
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,721
Messages
6,174,096
Members
452,542
Latest member
Bricklin

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