Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default is number between to other numbers.

In collumn a i have the zipcode a city starts with (4 numbers)
In collumn b i have the ziptcode a city ends with (4 numbers)
In collumn c i have the citynames etc etc
Is there a way to check is a zipcode entert belong to a city?
there are zipcodes not used?

Greetings Hans


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default is number between to other numbers.

Dim zip as String, z1 as Long, cell as Range
zip = "12345"
z1 = clng(Left(zip,4))
for each cell in Range(A2:A500")
if z1 = cell and z1 <= cell.offset(0,1) then
msgbox "City is " & cell.offset(0,2)
exit for
end if
Next

--
regards,
Tom Ogilvy


"hans" wrote:

In collumn a i have the zipcode a city starts with (4 numbers)
In collumn b i have the ziptcode a city ends with (4 numbers)
In collumn c i have the citynames etc etc
Is there a way to check is a zipcode entert belong to a city?
there are zipcodes not used?

Greetings Hans



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default is number between to other numbers.

=IF(ISNA(MATCH(1,(K1=A1:A10)*(K1<=B1:B10),0)),"No
match",INDEX(C1:C10,MATCH(1,(K1=A1:A10)*(K1<=B1:B 10),0)))

where K1 is the zipcode entered

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"hans" wrote in message
...
In collumn a i have the zipcode a city starts with (4 numbers)
In collumn b i have the ziptcode a city ends with (4 numbers)
In collumn c i have the citynames etc etc
Is there a way to check is a zipcode entert belong to a city?
there are zipcodes not used?

Greetings Hans




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default is number between to other numbers.

Thank.
Only Bob's solution has an error.

Greetings Hans

"hans" schreef in bericht
...
In collumn a i have the zipcode a city starts with (4 numbers)
In collumn b i have the ziptcode a city ends with (4 numbers)
In collumn c i have the citynames etc etc
Is there a way to check is a zipcode entert belong to a city?
there are zipcodes not used?

Greetings Hans



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default is number between to other numbers.

Probably NG wrap.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"hans" wrote in message
...
Thank.
Only Bob's solution has an error.

Greetings Hans

"hans" schreef in bericht
...
In collumn a i have the zipcode a city starts with (4 numbers)
In collumn b i have the ziptcode a city ends with (4 numbers)
In collumn c i have the citynames etc etc
Is there a way to check is a zipcode entert belong to a city?
there are zipcodes not used?

Greetings Hans





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
How to get the numbers above and below a number Raz Excel Worksheet Functions 10 March 2nd 09 06:55 PM
HOW DO I GET LIKE INVOICE NUMBERS TO GO TO THE NEXT NUMBER? norman New Users to Excel 1 September 27th 07 09:52 PM
IF a number is in between two numbers.... Andrew McLeod Excel Discussion (Misc queries) 2 January 30th 06 05:45 PM
number of spaces between numbers David Excel Discussion (Misc queries) 1 March 11th 05 08:39 PM
Can I re-number the row numbers? Val Excel Worksheet Functions 2 November 14th 04 07:29 PM


All times are GMT +1. The time now is 11:40 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"