PDA

View Full Version : Double Type error 13



Jenst
09-20-2016, 01:27 PM
Sorry guys,
I'm not getting to the solution on this problem:banghead:. This simple script should just apoint the value of a column to a variable(). But If I run the script, I get error 13 because of wrong type?? All the Variables like modulstafunc, modulendfunc are correct. Even the value of Activecell.Value is correctly shown, I simply cant explain it.


Sub Macro7()
Dim modulfunc() As Double
Dim loopcounterfunc As Long
Dim Modulstafunc As Long
Dim Modulendfunc As Long
C = Range("B7", Range("B7").End(xlDown)).Count
Modulstafunc = 7
Modulendfunc = C + 6
ReDim modulfunc(Modulstafunc To Modulendfunc)
For loopcounterfunc = Modulstafunc To Modulendfunc
Cells(loopcounterfunc, 2).Select
modulfunc(loopcounterfunc) = ActiveCell.Value
Next loopcounterfunc
End Sub

Thanks for your ideas!!! Jens

Paul_Hossler
09-20-2016, 01:49 PM
modulefunc() is for Doubles

If something in B7:Bx is text or something that cannot be converted to a Double, you'll get a 13

SamT
09-20-2016, 03:08 PM
Dim modulfunc
Dim loopcounterfunc As Long
Dim Modulstafunc As Long
Dim Modulendfunc As Long