double click userform

Moses99

New Member
Joined
Jul 2, 2019
Messages
11
I want to double click on a row, application.workbook.worksheet(1).range ("A1"). When I double click on it it shows a pop out a userform

Thank you in advance
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
you need to go to the code for the worksheet, and create a worksheet_DblClick event with something like this:

If target.col = 1 and target.row = 1 then Call LoadForm (or whatever your macro is)
 
Upvote 0
hi johnny C

i tried this for initial testing

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 1 And Target.Row = 1 Then
MsgBox ("HI")

End If

End Sub

it doesnt work. I want my double click only work on row A only
 
Upvote 0
sorry about that, it works, i wrote it like below

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 And Target.Row = 1 Then
MsgBox ("Hi")

End If

End Sub

How could I write a code for the entire colum A1 until all below
 
Upvote 0
I'll have a look tomorrow. My PC is running an all-night job at the moment.
 
Upvote 0
If you want to use double click try this.
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Target.Column = 1 And Target.Row = 1 Then
        Cancel = True
        MsgBox "Hi!"
    End If
End Sub
 
Upvote 0
Thanls Norie.
IIRC BeforeDoubleClick isnt listed as an option on wrksheet events, or it didnt used to be but you could still use it.
 
Upvote 0
Pretty sure it is, that's how I got the code stub anyway.:)
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,144
Members
453,021
Latest member
Justyna P

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