PDA

View Full Version : VBA click questions



KK1966
01-01-2009, 08:26 PM
hi, all

the double click functions can it be a 1 Click ??

I have code here's wanted to changed 1Click, please help help me,

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim MYRANGE As Range
Set MYRANGE = Range("a1:e1")
Cancel = True
If Not Application.Intersect(Target, MYRANGE) Is Nothing Then
Range("a3") = Target.Value
End If
End Sub


your help I really thanks a much

Kenneth Hobs
01-01-2009, 09:23 PM
Choose the SelectionChange event from the drop down list and post you code in it or change the name of that Sub. That sub goes in the sheet that you right click the sheet tab, View Code.

KK1966
01-01-2009, 10:27 PM
Kenneth


Thanks the suggestiog I understand

KK1966
01-02-2009, 12:31 AM
Hi ,

may i have you help again as the below srouce code why will disable the right click fuction in cursor even out the ranges>?

can u learn about.. thanks

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Dim MYRANGE As Range
Set MYRANGE = Range("A1:E1")
Cancel = True
If Not Application.Intersect(Target, MYRANGE) Is Nothing Then
Range("A3") = Target.Value
End If

End Sub

Artik
01-02-2009, 03:47 AM
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)

Dim MYRANGE As Range

Set MYRANGE = Range("A1:E1")

If Not Application.Intersect(Target, MYRANGE) Is Nothing Then
Cancel = True
Range("A3") = Target.Value
End If


End Sub
Artik

Artik
01-02-2009, 03:48 AM
Redundant post



Artik