"Find" Exact Match in Exel Cells

Lost Sailor

New Member
Joined
Apr 17, 2002
Messages
2
Hello,

I have two excel files. One is a data file and the other is destination file. I'm trying to "find" (match) in data file so that I can copy the values over to the destination file.

However, it return matchs of "2" when the actuall value is "12". Somehow it see the "2" in "12" and think it's an exact match.

Please let me know how to reslove seemingly simple error.

Thanks!

some code...

strEntry = Workbooks(strOutputBook).Worksheets("Raw Data").Cells(intRow, intCol)
.
.
Set rngSearch = .Range(.Cells(1, conWellColumn), .Cells(intDataRows, conWellColumn))
Set rngFound = rngSearch.Find(What:=strEntry, MatchCase:=True)

>>>> what is returned is the value of cell 2's value (in data file) when if "find" a match in cell 12 (destination).
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I think waht is happening is that you are receiving is the position of the the matched search in the lookup array which is what Match returns. Just coincidence that the number 12 is in that cell.
 
Upvote 0
I think my earlier message wan't clear.

The .Find command should search my column A of data file what is labled from 1 to 20. In Column B are the values that corespond to the cell label in column A.

In my destination file I have Column A labeled in random sequence from 1 to 20. Some number may be missing.

What I need to macro to do is to find "exact match" of label value in column A of both files and then copy the column B's value of Data file to column B of Destination file.

It's not doing that exactly. It'll copy over cell value of label 2 to labe 12 in destination file.

...I must missed something....appreciate any assistance.
 
Upvote 0

Forum statistics

Threads
1,213,558
Messages
6,114,297
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