1. put the following in view code of Mileage Chart:
-------------------------------------------------------------
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Worksheet.Name = "Mileage Chart" Then
Dim c As Integer
Dim r As Long
If Target.Count > 1 Then Exit Sub
c = Target.Column
r = Target.Row
If c < 2 Or c > 13 Or r < 3 Or r > 14 Then Exit Sub
Dim s As Worksheet
Set s = ActiveWorkbook.Worksheets("Travel Form")
With s
.Cells(getar(), 6) = Target.Value
.Cells(getar(), 3) = Cells(2, c).Value
.Cells(getar(), 2) = Cells(r, 1).Value
End With
End If
End Sub
-----------------------------------------------------
2. Put the following in View Code of Travel Form:
-----------------------------------------------------
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
setar Target.Row
End Sub
-----------------------------------------------------
3. Then don't close the window but choose Insert/Module. Put the
following in there:
Option Explicit
Public ar As Integer
Public Sub setar(i As Integer)
ar = i
End Sub
Public Function getar() As Integer
getar = ar
End Function