JDDMichael
New Member
- Joined
- Sep 19, 2011
- Messages
- 1
Hey all,
So I am a bit baffled why the following code works fine on one PC but does nothing if I send the XLS over to someone else with a different version of Excel:
Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Excel.Range, Cancel As Boolean)
Dim TopRow As Long
Dim BottomRow As Long
Dim MyTick As String
'--------------------------------------------------
MyTick = Chr(252) ' Wingdings font tick
TopRow = 3
BottomRow = 100
'- check cell is within limits set
If Target.Column = 2 Or Target.Column = 4 Or Target.Column = 6 Or Target.Column = 8 Or Target.Column = 10 _
And Target.Row >= TopRow _
And Target.Row <= BottomRow Then
If Target.Value = "" Then ' if cell empty
Target.Value = MyTick ' put tick
Else ' otherwise
Target.Value = "" ' remove tick
End If
Target.Offset(1, 1).Select ' move 1 cell down
End If
End Sub
Any ideas?
** Update: Uhg... Newb mistake. All of the other systems are disabling macros... **
So I am a bit baffled why the following code works fine on one PC but does nothing if I send the XLS over to someone else with a different version of Excel:
Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Excel.Range, Cancel As Boolean)
Dim TopRow As Long
Dim BottomRow As Long
Dim MyTick As String
'--------------------------------------------------
MyTick = Chr(252) ' Wingdings font tick
TopRow = 3
BottomRow = 100
'- check cell is within limits set
If Target.Column = 2 Or Target.Column = 4 Or Target.Column = 6 Or Target.Column = 8 Or Target.Column = 10 _
And Target.Row >= TopRow _
And Target.Row <= BottomRow Then
If Target.Value = "" Then ' if cell empty
Target.Value = MyTick ' put tick
Else ' otherwise
Target.Value = "" ' remove tick
End If
Target.Offset(1, 1).Select ' move 1 cell down
End If
End Sub
Any ideas?
** Update: Uhg... Newb mistake. All of the other systems are disabling macros... **
Last edited: