Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Value as part of another value

Hi group
I need a way to check, if StreetAdress_1 is part of StreetAdress_2
Really im comparing 2 adresslists by streetname, but I want to omit the
housenumber, which is not all accurate.
Any Idea's ?

--
Med venlig hilsen
Peter Hesselager-Olesen
SBS-IT Aps

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Value as part of another value

That is a space between the double quotes, not a null string.

If Left(StreetAddress_1, InStr(StreetAddress_1, " ") - 1) _
= Left(StreetAddress_2, InStr(StreetAddress_2, " ") - 1) Then
'Do something
End If

I did not test this so there could be errors, but basically use the Left
function
and the InStr function in tandem to designate the point in the string that
you want to
evaluate. This would only compare everything up to the first space, so if
your street name has more than one word, it might not work so good.
"Peter Hesselager" wrote:

Hi group
I need a way to check, if StreetAdress_1 is part of StreetAdress_2
Really im comparing 2 adresslists by streetname, but I want to omit the
housenumber, which is not all accurate.
Any Idea's ?

--
Med venlig hilsen
Peter Hesselager-Olesen
SBS-IT Aps

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Value as part of another value

Peter, disregard that. I had my head backward. The street number comes
first in the U.S. So, it would have to use a Mid Function in tandem with a
InStr and Len function to work out the math so that only the street name
would be returned.

"Peter Hesselager" wrote:

Hi group
I need a way to check, if StreetAdress_1 is part of StreetAdress_2
Really im comparing 2 adresslists by streetname, but I want to omit the
housenumber, which is not all accurate.
Any Idea's ?

--
Med venlig hilsen
Peter Hesselager-Olesen
SBS-IT Aps

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Value as part of another value

Hi
I worked the same idea, but some street names have more than one space (
South Street 7 ).

To overcome this problem I decided to test if StreetAdress1 (value now being
only "South") is part of ( is contained in -) StreetAdress2, which remains
unchanged ( South Street 7 )
I know it's not perfect - but the way data are, it will produce only a few
"mistakes"

When using the ordinary AutoFiltering in excel, you have the possibility to
filter for Value "contained in" ....

Is there a similar VB-expression to use on this problem ??


--
Med venlig hilsen
Peter Hesselager-Olesen
SBS-IT Aps



"JLGWhiz" skrev:

Peter, disregard that. I had my head backward. The street number comes
first in the U.S. So, it would have to use a Mid Function in tandem with a
InStr and Len function to work out the math so that only the street name
would be returned.

"Peter Hesselager" wrote:

Hi group
I need a way to check, if StreetAdress_1 is part of StreetAdress_2
Really im comparing 2 adresslists by streetname, but I want to omit the
housenumber, which is not all accurate.
Any Idea's ?

--
Med venlig hilsen
Peter Hesselager-Olesen
SBS-IT Aps

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
spreadsheet part and part without grid lines jan Excel Discussion (Misc queries) 2 April 26th 10 11:27 PM
Search/Match/Find ANY part of string to ANY part of Cell Value TWhizTom Excel Worksheet Functions 0 July 21st 08 08:16 PM
Reduce a range to just be the part within another part? tskogstrom Excel Programming 1 October 7th 06 04:07 AM
Copying Part of a row down part of a column Not Excelling Excel Discussion (Misc queries) 3 January 6th 06 11:58 PM
How can I sperate the module into two part and connecte the two part and work well? ¬f©÷ Excel Programming 1 November 7th 04 03:05 AM


All times are GMT +1. The time now is 09:56 AM.

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

About Us

"It's about Microsoft Excel"