Launch Userform when cursor enters cell

megnin

Active Member
Joined
Feb 27, 2002
Messages
340
Is it possible to launch a Userform when a user enters a particular cell, either with the cursor or by mouse?

Thanks
DM
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Use the WorkSheet Selection Change Event

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address=$A$1 Then Userform1.Load
End Sub

Place this code in the worksheet module
 
Upvote 0
This code will open userform when the cell $A$1 is selected.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Address = "$A" Then
        UserForm1.Show
    End If
End Sub

How to insert code:

Open VB Editor by: right clicking on the tab of the sheet you want code in, then select "view code" from drop

Once inside VB Editor Paste the code into the Right Window.
Done !
Note: in the code the "$A" should read "$A$1" for some reason the $1 gets lost when I paste it over as code.

_________________
NOTE: Testing performed on Win2K utilizing Office 2000. Solutions may need tweaking for other versions.<font size=+2><font color="blue"> Adieu,<font color="red">N<font color="blue">imrod</font></font></font>
This message was edited by Nimrod on 2002-05-29 09:18
This message was edited by Nimrod on 2002-05-29 09:19
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top