PDA

View Full Version : Copy to next cell blank



Romulo Avila
10-31-2016, 03:18 AM
Good Morning,
I have a spreadsheet with various names, and when I use the code by clicking on a particular cell the value of this cell and loaded into cell D10, I need you to go selecting other names you go by pressing the sequence D11, D12, D13 ....


Thank you


*** Code ***
Private Sub Worksheet_SelectionChange (ByVal Target As Range)
Range ( "D10") = Target.Value
end Sub

mana
10-31-2016, 05:06 AM
I would use BeforeDoubleClick event.



Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, Columns("A:B")) Is Nothing Then Exit Sub
Range("D" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
Cancel = True
End Sub

Romulo Avila
10-31-2016, 11:04 AM
Good afternoon,


Thanks for the support ..


Taking advantage, the who to the line

If Intersect(Target, Columns("A:B")) Is Nothing Then Exit Sub