View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Philosophaie Philosophaie is offline
external usenet poster
 
Posts: 110
Default Cdbl and Cstr with a "Type Mismatch" Error

Sub This()
Dim A,B,C as Double
Dim S as String
With Sheets("Sheet1")
A=.cells(1,1)
B=.cells(1,2)
C=.cells(1,3)
S=.cells(1,4)
End With
End Sub

This worked one time after that a "Type mismatch" error. Tried these
solutions but none worked:

A=Cdbl(.cells(1,1))
B=Cdbl.cells(1,2))
C=Cdbl(.cells(1,3))
S=Cstr(.cells(1,4))

A=.cells(1,1).Value
B=.cells(1,2).Value
C=.cells(1,3).Value
S=.cells(1,4)

Where am I going wrong?