Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using the following macro to increase the value of a cell on a double
click how. I cannot make it work for columns c,d,e,and f. Can anyone offer any solutions? Private Sub Worksheet_BeforeDoubleClick(ByVal Target _ As Range, Cancel As Boolean) If Target.Row = 1 Then Exit Sub If Target.Column < 2 Then Exit Sub 'Require Col B On Error Resume Next Application.EnableEvents = False Target.Value = Target.Value + 1 Application.EnableEvents = True If Err.Number < 0 Then MsgBox "Unable to add 1 to value in cell " _ & Target.Address(0, 0) End If End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Change
If Target.Column < 2 Then Exit Sub 'Require Col B to If Target.Column < 3 Or Target.Column 7 Then Exit Sub -- HTH RP (remove nothere from the email address if mailing direct) "kara" wrote in message ... I am using the following macro to increase the value of a cell on a double click how. I cannot make it work for columns c,d,e,and f. Can anyone offer any solutions? Private Sub Worksheet_BeforeDoubleClick(ByVal Target _ As Range, Cancel As Boolean) If Target.Row = 1 Then Exit Sub If Target.Column < 2 Then Exit Sub 'Require Col B On Error Resume Next Application.EnableEvents = False Target.Value = Target.Value + 1 Application.EnableEvents = True If Err.Number < 0 Then MsgBox "Unable to add 1 to value in cell " _ & Target.Address(0, 0) End If End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean) If Target.Row = 1 Then Exit Sub If Target.Column < 2 or Target.column 6 Then Exit Sub 'Require Col B On Error Resume Next Application.EnableEvents = False Target.Value = Target.Value + 1 Application.EnableEvents = True If Err.Number < 0 Then MsgBox "Unable to add 1 to value in cell " _ & Target.Address(0, 0) End If End Sub -- Regards, Tom Ogilvy "kara" wrote in message ... I am using the following macro to increase the value of a cell on a double click how. I cannot make it work for columns c,d,e,and f. Can anyone offer any solutions? Private Sub Worksheet_BeforeDoubleClick(ByVal Target _ As Range, Cancel As Boolean) If Target.Row = 1 Then Exit Sub If Target.Column < 2 Then Exit Sub 'Require Col B On Error Resume Next Application.EnableEvents = False Target.Value = Target.Value + 1 Application.EnableEvents = True If Err.Number < 0 Then MsgBox "Unable to add 1 to value in cell " _ & Target.Address(0, 0) End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 Macro/VB Question DDE Question | Excel Worksheet Functions | |||
Macro Question | Excel Worksheet Functions | |||
Macro Question | Excel Discussion (Misc queries) | |||
MACRO QUESTION | Excel Worksheet Functions | |||
one last macro question | Excel Programming |