View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Unspecified Automation Error


I haven't had a lot of time to play with this. Maybe you can send me a
sample wb. However, somewhere there must be a better way???

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ron Rosenfeld" wrote in message
...
On Wed, 24 Jun 2009 16:47:33 -0500, "Don Guillett"

wrote:

I installed these functions in a regular module and entered on the sheet
=revzip(78731) and got Austin
I didn't get any other hits for that zip and didn't get TX



Don,

Did you see my response to this question of yours?
Were you able to confirm it?

Thanks.

-- Ron

----------------------------
You probably overlooked the comment at the beginning of the routine that
the
function returns a 2D array of city-state pairs.

If I go to the formula bar, and select <F9, I see:

{"AUSTIN","CAMP MABRY";"TX","TX"}

So to pull out each city-state pair using this function, you need to use
the
INDEX function.

For example,

=INDEX(RevZip($A$1),ROWS($1:1),COLUMNS($A:A))

filled to the right 1 cell and down 1 cell (with 78731 in A1), returns:

AUSTIN CAMP MABRY
TX TX

in four separate cells.

This function is much more efficiently used in a Sub that would populate
the
worksheet. In a Sub, you can make a single call to the UDF and then
output the
resultant array appropriately.

On the other hand, if you have this formula in four worksheet cells, then
there
are four calls to IE, and that will take a considerable amount of time.

--ron
--ron