VBA Find with multiple Criteria

hajiali

Well-known Member
Joined
Sep 8, 2018
Messages
626
Office Version
  1. 2016
Platform
  1. Windows
How can add a second Criteria to find the Shift in column X to that of Column G or Column K. in the example the find locates "JODY" in Cell L5 and not F20. see below let me know if I need to clarify anything. Any information is greatly appreciated

VBA Code:
For Each r In Range("Y5:Y138")
    Set Rclr = Range("F4:L500").Find(r, LOOKAT:=xlWhole)
'NAME NOT FOUND
        If Rclr Is Nothing Then
            r.Font.ColorIndex = 3
            GoTo r
        End If

Book2
ABCDEFGIKLMNOPQRVWXY
1Wednesday, May 15, 2024
2
3NAMESHIFTSHIFTNAME SHIFT TRADES
4JOHN03:15-11:1511:00-19:30RYANNAMETIME (TTW, PSTW)FOR
5BILL03:15-11:1511:00-19:30JODY JADE04:30-13:00JODY
6AMANDA04:15-12:4512:30-21:00MOE 
7PETER05:30-14:0013:15-21:45JENNIFER 
8LIZ04:30-13:0012:45-21:15JENN 
9 
10 
11 
12NAMESHIFTSHIFTNAME 
13 
14DOM03:15-11:1511:00-19:30BRIAN 
15TOM03:15-11:1511:00-19:30SARA 
16WILL03:15-11:1511:00-19:30BRYAN 
17HAJI03:15-11:1512:30-21:00TOM 
18ALI05:30-14:0014:45-23:15MARY 
19TIM05:30-14:0014:45-23:15ERIK 
20JODY04:30-13:0012:30-21:00STEP 
21LISA05:30-14:0014:45-23:15TONI 
Sheet1
Cell Formulas
RangeFormula
V5:V21V5=IFERROR(RIGHT(U5,LEN(U5)-FIND("-",U5)),"")
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

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