How to show up an input box when clicking on a cell in Excel?
If you want to show up an input box to enter some content when clicking on a cell in a specified range in Excel. A method in this article can help you.
Enable you to do smarter, faster and better
Please do as follows to show up an input box when clicking on a cell in Excel.
1. The shift to the worksheet you need to show up input box inside, right-click the sheet tab and click View Code from the right-clicking menu.
2. Then the Microsoft Visual Basic for Applications window pops up, please copy and paste below VBA code into the Code window.
VBA code: Show up input box when clicking on a cell in Excel
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim xRtn As Variant If Selection.Count = 1 Then If Not Intersect(Target, Range("B:B")) Is Nothing Then xRtn = Application.InputBox("Insert your value please", "KuTools For Excel") If xRtn <> False Then Target.value = xRtn End If End If End Sub
Note: In the code, B:B is the specified range which the input box will show up when clicking on any cells inside the range. Please change it based on your needs.
3. Press the Alt + Q keys to close the Microsoft Visual Basic for Applications window.
4. When clicking on any cell in column B, a Kutools for Excel input box will pop up. Please enter your needed content and then click the OK button. See screenshot.
Then the content is inserted into the selected cell immediately.