Matching similar but not exact text strings in Excel VBA projects

后端 未结 5 1745
忘了有多久
忘了有多久 2020-11-30 10:31

Okay, I have been trying to find a solution for this and I just don\'t seem to be able. I can\'t even break down the problem properly. This is the idea.

I have two s

5条回答
  •  -上瘾入骨i
    2020-11-30 11:18

    Not exactly on point but similar, and people dealing with my issue are likely to find this page when searching.

    Task: A list of patients who have been in car wrecks, including street addresses. Find related accounts based on same street address. The list will be a maximum of maybe 120 records--so partial manual review is realistic.

    Problem: Street addresses are similar but not identical, e.g. 123 JONES LANE and 123 JONES LN or 72 MAIN STREET #32 and 72 MAIN STREET # 32.

    Part of the solution is to compare only the street numbers. With a list that size it's unusual to have two different addresses with the same street number (e.g., 123 JONES LANE and 123 MAIN STREET).

    Caution: You can't use VAL() to pull the street number. Try it with 167 E 13 ST. VBA sees that as 167^13 and will crash if you are outputting to Street_Num As Integer. So you have to use a loop to pull the digits into a new string and stop at the first non-digit character.

提交回复
热议问题