.Find(x) for an Exact match?

cemiloguz

New Member
Joined
Jul 21, 2011
Messages
1
I am trying find a certain text (x) in the first row of a column exactly in file (DestDat) and when found replace one of the cells below it, with (x):

Dim x As Variant
Dim R As clsFind
Set R = New clsFind
Do While Not IsEmpty(ActiveCell.Value)
x = ActiveCell.Value
Dim dataContent As Variant
dataContent = Cells(SrcRow, ActiveCell.Column).Value
DestDat.Activate
Dim wsCount As Integer
If R.FindColumn(x, DestDat) Then
DestDat.Activate
R.GetWorksheet.Activate
Cells(DestRow, R.GetColumn.Column).Value = dataContent
End If

In this case above, If I am looking for "Door6", and then it finds "Door60", then it stops because it assumes that it found it because "Door6" is a subset of "Door60"

However, I want an exact match. If the (x) is "Door6" then it should loom for that only as an exact match.

Is there any way of doing that?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
There's an argument you can use with the built-in Find method, but you don't seem to be using that.

The thing I can see that involves finding is FindColumn, which appears to belong to the class clsFind.

So the actual code for FindColumn is in that class, and it's there any change would need to be made.

Or you could just use VBA's own Find method.:)
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

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