Here is the code with some explanatory comments. I hope this helps.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B5:F5")) Is Nothing Then Exit Sub 'restricts input to B5:F5
Dim Train As Range
Dim station As Long
Set Train = Sheets("Trains").Range("A:A").Find(Target, LookIn:=xlValues, lookat:=xlWhole) 'finds your selection in the "Trains" sheet
If Not Train Is Nothing Then 'when your selection is found, the next lines of code are executed
station = Sheets("Station").Range("B:B").Find(Target.Offset(-1, 0)).Row 'finds the station in the cell above your selection in the "Station" sheet
Sheets("Trains").Range("B" & Train.Row & ":J" & Train.Row).Copy Sheets("Station").Cells(station, 3) 'copies the range B:J from the "Trains" sheet to the appropriate row in the "Station" sheet
End If
End Sub
Bookmarks