Vba input box and display in cell in Excel
To do it in Excel, here is the answer:
- Option Explicit
- Sub InputBoxExample()
- ActiveSheet.Range("G2") = InputBox("Enter a test value", "InputBox Example")
- End Sub
Result after Macro execution:
a) Line 3 displays a prompt as shown below. The value entered by user is then recorded in cell "G2".
b) Enter a Test value (5 in the example below). Click OK.
c) Cell G2 is updated with value entered by user.