How to Popup Text Box with a Single Click Using VBA in Microsoft Excel 2010

In this article, you will learn how to pop-up text with a single click using VBA code.
 
Let us understand with an example:

To view a textbox pop-up as you click on particular cell, you need to follow the below steps
 
Click on Developer tab

From Code group, select Visual Basic
 
img1
 
Enter the following code in the Sheet1

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    If Intersect(Target, Range("A1")) Is Nothing Then

ActiveSheet.Shapes.Range(Array("TextBox 1")).Visible = False

    Else

ActiveSheet.Shapes.Range(Array("TextBox 1")).Visible = True

    End If

End Sub
 
img2
 
The SelectionChange event will ensure whenever cell A1 is clicked, the Textbox will get pop-up. Refer below snapshot
 
img3
 
In this way, we can let the other person to enter their information correctly.
 
 

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.