Malcolm torishi
Board Regular
- Joined
- Apr 26, 2013
- Messages
- 219
Hi can anyone help please, I have the following code that clear the contents as well as the formulas on my spreadsheet. Can any tell me please how not to clear the formulas . Thanks
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Modified 6/18/2019 3:09 PM EDT
If Target.Column = 28 And Target.Row > 1 Then
Cancel = True
Dim Lastrow As Long
Lastrow = Sheets(3).Cells(Rows.Count, "A").End(xlUp).Row + 1
Target.Offset(, -25).Resize(, 1).Copy Sheets(3).Cells(Lastrow, 1)
Target.Offset(, -25).Resize(, 25).ClearContents
End If
If Target.Column = 1 Then
Cancel = True
Target.Font.Name = "Wingdings"
If Target.Value = "" Then
Target.Value = "ü"
Else
Target.Value = ""
End If
End If
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Modified 6/18/2019 3:09 PM EDT
If Target.Column = 28 And Target.Row > 1 Then
Cancel = True
Dim Lastrow As Long
Lastrow = Sheets(3).Cells(Rows.Count, "A").End(xlUp).Row + 1
Target.Offset(, -25).Resize(, 1).Copy Sheets(3).Cells(Lastrow, 1)
Target.Offset(, -25).Resize(, 25).ClearContents
End If
If Target.Column = 1 Then
Cancel = True
Target.Font.Name = "Wingdings"
If Target.Value = "" Then
Target.Value = "ü"
Else
Target.Value = ""
End If
End If
End Sub