Error trying to find value in column

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,422
Office Version
  1. 2016
Platform
  1. Windows
I have this formula which I use to find if a value exists in a range;

Code:
For Each cell In Sheet14.Range("B4:B23")

Set found = Sheet4.Columns("N").Find(what:=cell.Offset(0, 15), LookIn:=xlValues, LookAt:=xlWhole)

If found Is Nothing Then
Exit Sub
If cell.Offset(0, 2) = "Area" Or cell.Offset(0, 2) = "Sub" Or cell.Offset(0, 2) = "Visit" Or cell.Offset(0, 2) = "Office" Then

So what this is supposed to do is search column N to see if the value in column Q is there, and if it is then run the next part;

Code:
If cell.Offset(0, 2) = "Area" Or cell.Offset(0, 2) = "Sub" Or cell.Offset(0, 2) = "Visit" Or cell.Offset(0, 2) = "Office" Then

The issue I'm having is that it is not finding the value, even though it is there and exists.

Now I don't know if this makes a difference, but the values being searched is a numeric one which is actually a formula result in column N and Q - would this make a difference?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
What an idiot - completely missed that....

Thanks - working now!
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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