On cell double click

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
693
Is it possible to open up a userform when a cell in worksheet is double clicked?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try this: right click the sheet tab, select View Code and paste in

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Address(False, False) = "A1" Then
    Cancel = True
    userform1.Show
End If
End Sub

Change A1 to suit.
 
Upvote 0
Yes as VoG has stated...
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    MyForm.Show
End Sub
 
Upvote 0
Thanks VoG

Just to expand on that a little, I want that to be possible for each cell in column A (or ideally from A3 to the last row)
 
Upvote 0
Try this

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
If Not Intersect(Target, Range("A2:A" & LR)) Is Nothing Then
    Cancel = True
    userform1.Show
End If
End Sub
 
Upvote 0
Thanks, works perfectly

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
If Not Intersect(Target, Range("A3:A" & LR)) Is Nothing Then
    Cancel = True
    Sheets("MainMenu").cboIssue.Value = Target.Offset(, 4).Value
    UserForm2.cboIssueID = Target.Value
    UserForm2.Show
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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