Consulting

Results 1 to 3 of 3

Thread: Copy to next cell blank

  1. #1

    Copy to next cell blank

    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

  2. #2
    VBAX Expert
    Joined
    Sep 2016
    Posts
    788
    Location
    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

  3. #3
    Good afternoon,


    Thanks for the support ..


    Taking advantage, the who to the line

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •