I've gotten a Run-Time Error 6 while running some code, and while debugging I started to take away parts of it, until I was left with this very, very simple code, and still got an error
Sub test()
Dim NumberTest As Double
NumberTest = 1 / 2
End Sub
Error happens on the third line when I step into the code. Anyone knows what could be causing it? I'm on Excel 2016 for Mac
NumberTest = cdbl(1 / 2)or some other variant of the equationNumberTest = cdbl(1) / 2(as per the link) and see if the error persists.Integerliterals. Try converting either (or both) toDoublefirst, using theCDblconversion function. Are you sure this minimal reproducible example is correctly representative of the actual problem? Real code seldom divides two integer literals like this (you'd conceivably haveConst half As Double = 0.5instead).Doubleliterals. DoesNumberTest = 1# / 2#still overflow?