View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Philosophaie Philosophaie is offline
external usenet poster
 
Posts: 110
Default CDbl and "Type mismatch"

Neither of these cases work. I just get a "Type mismatch" error.

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

deg(h) = CDbl(.Cells(2 + h, 3))
min(h) = CDbl(.Cells(2 + h, 4))
sec(h) = CDbl(.Cells(2 + h, 5))
DEGt(h) = deg(h) + min(h))/ 60 + sec(h) / 3600
or
deg(h) = .Cells(2 + h, 3)
min(h) = .Cells(2 + h, 4)
sec(h) = .Cells(2 + h, 5))
DEGt(h) = CDbl(deg(h)) + CDbl(min(h)) / 60 + CDbl(sec(h)) / 3600