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

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
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,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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