slayer1957
Board Regular
- Joined
- Jan 9, 2017
- Messages
- 50
Good day,
I need a Private sub when double clicked on a cell it must do the same as putting the cell to edit mode F2 and highlighting/selecting all text and copying it to clipboard. Currently it copies the text but when pasting in another program it pastes with multiple line breaks and i have to go and edit the whole document again. The code i have now is below.
I need a Private sub when double clicked on a cell it must do the same as putting the cell to edit mode F2 and highlighting/selecting all text and copying it to clipboard. Currently it copies the text but when pasting in another program it pastes with multiple line breaks and i have to go and edit the whole document again. The code i have now is below.
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)On Error Resume Next
If Target.Value <> "" Then
Target.Copy
End If
Cancel = True
End Sub