Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default if it looks like it matches, it's a match

match, vlookup, etc. works sporadically due to apparent formatting
differences. i am trying to match the contents of 1 cell with it's
"look-a-like" in an array. the problem comes b/c many of the inputs come
from a database or some other form and may be formatted as something other
than my 1 cell, like as text, with spaces, etc. i have tried trim, .value,
etc. "if it looks like it matches w/ the naked eye, it's a match" is what i
am looking for.

Sub matchingdata()
'Dim loanorig As ???? 'tried a few things here
loanorig = Range("o30") 'tried .value and trim(...)
loansold = Range("n30")
loanorigrow = Application.Match(loanorig, Range("a1:a500"), 0)
'PROBLEM
loansoldrow = Application.Match(loansold,Range"a1:a500"),0)
'more code here
End Sub

these are in range("n30") and range("o30"), respectively.
16004665102

6004665102


in range("a1:a500") both of these are certainly there by the looks of it,
but only "n30" works, while "o30" causes: the variable "loanorigrow" to
return "type mismatch" with "error 2042" as that variable.
the bottom line is i need a sure-fire, consistent way of matching apparently
identical data, no matter what form it is in, which will be many. "if it
looks like it matches w/ the naked eye, it's a match" is the option i need
in this case. any ideas? thanks, mike allen


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default if it looks like it matches, it's a match

Hi Mike,

You may find a visit to David McRitchie's TrimAll page with its discussion
notes and TrimAll routines useful:

http://www.mvps.org/dmcritchie/excel/join.htm#trimall


---
Regards,
Norman


" wrote in message
...
match, vlookup, etc. works sporadically due to apparent formatting
differences. i am trying to match the contents of 1 cell with it's
"look-a-like" in an array. the problem comes b/c many of the inputs come
from a database or some other form and may be formatted as something other
than my 1 cell, like as text, with spaces, etc. i have tried trim,

..value,
etc. "if it looks like it matches w/ the naked eye, it's a match" is what

i
am looking for.

Sub matchingdata()
'Dim loanorig As ???? 'tried a few things here
loanorig = Range("o30") 'tried .value and trim(...)
loansold = Range("n30")
loanorigrow = Application.Match(loanorig, Range("a1:a500"), 0)
'PROBLEM
loansoldrow = Application.Match(loansold,Range"a1:a500"),0)
'more code here
End Sub

these are in range("n30") and range("o30"), respectively.
16004665102

6004665102


in range("a1:a500") both of these are certainly there by the looks of it,
but only "n30" works, while "o30" causes: the variable "loanorigrow" to
return "type mismatch" with "error 2042" as that variable.
the bottom line is i need a sure-fire, consistent way of matching

apparently
identical data, no matter what form it is in, which will be many. "if it
looks like it matches w/ the naked eye, it's a match" is the option i

need
in this case. any ideas? thanks, mike allen




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compare rows for a match and sum the matches Bert Excel Worksheet Functions 1 April 30th 09 09:27 PM
Excel 2003: Match Names; View Unfound Matches? 99cateyes Excel Worksheet Functions 1 February 18th 09 03:17 PM
How to match date criteria then calculate an average of matches Buffy M. Warren Excel Worksheet Functions 5 November 21st 07 03:22 AM
Match function selecting first value it matches on exactly Paul K. Excel Worksheet Functions 1 February 24th 05 08:57 PM
MATCH function - how to find multiple matches ?? Keith Excel Programming 6 March 2nd 04 01:50 PM


All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"