Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: "Find" Exact Match in Exel Cells

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Brisbane, Down Under
    Posts
    542
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #3
    New Member
    Join Date
    Apr 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •