Thread: Type mismatch !
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.robinson@it-tallaght.ie is offline
external usenet poster
 
Posts: 789
Default Type mismatch !


Hi

Try
var1 as string
var1 = Cells(1, 1).Text

I'd have thought the Variant declaration would do it, but it seems not.
Anyone out there know why not? I couldn't find the type of an error in
the Errors collection

You could also do
var1 as Variant
var1 = Cstr(Cells(1,1).Value)

but this returns
Error 2042

regards
Paul