View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default question on macro

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