Forum Discussion
Archangelz93
Jun 02, 2019Copper Contributor
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...
- Jun 02, 2019
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 SubBest regards from germany
Bernd
http://www.vba-tanker.com - a database full of excel-macros
Berndvbatanker
Jun 02, 2019Iron Contributor
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
- Archangelz93Jun 02, 2019Copper ContributorHi,
Thank you, this was exactly what I was looking for!
Wish you the best :)