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.
- Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
- More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
- Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
- Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
- Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
- Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
- More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.
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.