Forum Discussion

Archangelz93's avatar
Archangelz93
Copper Contributor
Jun 02, 2019
Solved

Try to copy number from one table to another

Hello, I am quite new to Excel.   I am currently in the progress of making an encounter list with the help of Excel. What I want to do is the following: Sheet 1 (named Encounter) has a table nam...
  • Berndvbatanker's avatar
    Jun 02, 2019

    Archangelz93 

    hi, try this event behind Tabelle1, see attached file

     

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rngFind As Range

    If Target.Address(False, False) = "A2" Then
    Set rngFind = Tabelle2.Range("C:C").Find(what:=Target.Value, lookat:=xlWhole)

    With Tabelle2
    If Not rngFind Is Nothing Then
    .Range(.Cells(rngFind.Row, "D"), .Cells(rngFind.Row, "J")).Copy Destination:=Cells(Target.Row, "B")
    End If
    End With

    End If
    End Sub

     

    Best regards from germany

    Bernd

    http://www.vba-tanker.com - a database full of excel-macros