I am trying to create a function that will take the value of a cell formatted something like 5.23*10^-3 and be able to use it in a calculation.
Sub Multiplication_Stuff
Dim a As Double
a = Range('ActiveSheet!$B$2').Value *****
c = multiplyme(a)
Range("Sheet1!B7) = C
End Sub
Public Function multiplyme(a As Double) As Double
multiplyme = a * 15
End Function
I received the following error in the code:
run-time error'1004' Method 'Range'Of object'_Global' failed
I have also had it formatted the way the range for c is formatted and recieved the same error. i would prefer it to not pull from active sheet but sheet 1 instead.