gallen
Well-known Member
- Joined
- Jun 27, 2011
- Messages
- 2,016
I want to be able to double click a cell and have VBA to copy the row of information.
I currently have:
If I step through the code, it works fine, but if I do this normally, I can see it copies but then the cursor goes within the cell and the copy seems to be 'cancelled' ie. you can no longer paste.
In essence I want to double click the cell to copy the row then in a different woorkbook, paste the copied cells.
Must be something basic I'm doing wrong. Any clues?
I currently have:
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)'code to copy the row of information to the clipboard
Application.EnableEvents = False
Dim s As String
If Target.Value <> "" Then
s = "B" & Target.Row & ":H" & Target.Row
Range(s).Copy
End If
Application.EnableEvents = True
End Sub
If I step through the code, it works fine, but if I do this normally, I can see it copies but then the cursor goes within the cell and the copy seems to be 'cancelled' ie. you can no longer paste.
In essence I want to double click the cell to copy the row then in a different woorkbook, paste the copied cells.
Must be something basic I'm doing wrong. Any clues?