Thread: Len(ZipCode)
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Len(ZipCode)

Rafi,

I've never encountered a format of 'Zip' is it in 2007?

However, if the leading zero is a format then LEN() won't count it. Why
don't you enter your Zip codes with a leading apostrophe ' then len will work.

Mike

"Rafi" wrote:

How do you test the length of a zip code starting with zero (e.g. 07580)?
The column in Excel is formatted as Zip and the page correctly displays the
leading zero however, a test of the length returns 4. Is there a way using
VBA to properly test for a zip code whose first digit is a zero?