I've been following Andrew Gould's VBA Introduction video series on YouTube and everything was running fine up till episode 11.2 - Application.InputBox
I type in Andrew's code letter-for-letter, you may compare it e.g. https://youtu.be/NvGv1n4TW28?t=1144
So when I type in the code I get 1004 Run-time error while in Andrew's video everything seems to run smoothly.
What gives?
I type in Andrew's code letter-for-letter, you may compare it e.g. https://youtu.be/NvGv1n4TW28?t=1144
So when I type in the code I get 1004 Run-time error while in Andrew's video everything seems to run smoothly.
What gives?
Code:
Sub EnterAFormula()
Dim Myformula As String
Myformula = Application.InputBox(Prompt:="Enter a formula", Type:=0)
Range("G2").FormulaLocal = Myformula
End Sub