View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default CDbl and "Type mismatch"

I'm not entirely sure why you are getting a "Type Mismatch" error, at least
not with the code fragment you showed us (maybe the error is occurring
elsewhere in your code), but your array limits are wrong. You showed this in
your code...

Dim deg(10), min(10), sec(10), DEGt(10) as Double


and you just told me this...

for h = 1 to 23


so when "h" hits 11, there will be a problem as your array is not big enough
to hold that index value (but I would not expect a "Type Mismatch" error to
be occurring for it). Perhaps if you post all of your code (copy/paste it,
don't retype it as I see some mistyping in the code you posted originally).

--
Rick (MVP - Excel)



"Philosophaie" wrote in message
...
for h = 1 to 23
...
next h

deg(1)=20
min(1)=45
sec(1)=21
DEGt(1)=20.755833333