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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
What an idiot - completely missed that....

Thanks - working now!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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