find method...two parameter

sal21

Active Member
Joined
Apr 1, 2002
Messages
291
I use this code to find in column if is prersent a value, but the code work only if i use ONE column in this case is O.



Set found_index = WS.Columns("O:O").Find(SERV, LookIn:=xlFormulas)
If Not found_index Is Nothing Then
...
Do one code...

End If

Now admit i have

My_SERV to find in L
and
My_SRRV1 to find in O

how to?
Naturally use the find on same line in sheet an naturally other way are welcome.
Tks.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Code:
Set found_index = WS.Columns("L:L").Find(MY_SERV, LookIn:=xlFormulas)
If Not found_index Is Nothing Then
    firstFoundAddress = found_index.Address
    
    Do
       If found_index.Offset(0, 3).Value = MY_SERV2 Then
           Rem code
           firstFoundAddress = found_index.Address
       Else
           Set found_index = WS.Columns("L:L").Find(MY_SERV, after:=found_index, LookIn:=xlFormulas)
       End If
    
    Loop While found_index.Address <> firstFoundAddress
    
End If
 
Upvote 0
Code:
Set found_index = WS.Columns("L:L").Find(MY_SERV, LookIn:=xlFormulas)
If Not found_index Is Nothing Then
    firstFoundAddress = found_index.Address
    
    Do
       If found_index.Offset(0, 3).Value = MY_SERV2 Then
           Rem code
           firstFoundAddress = found_index.Address
       Else
           Set found_index = WS.Columns("L:L").Find(MY_SERV, after:=found_index, LookIn:=xlFormulas)
       End If
    
    Loop While found_index.Address <> firstFoundAddress
    
End If

hI mikerickson tks for code....

In wich part of your code i can insert my other code line when the two codition are respected? (peraphs in Rem code)
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,315
Members
448,564
Latest member
ED38

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