![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 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). |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Brisbane, Down Under
Posts: 533
|
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.
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 2
|
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. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|