Hi Matthew
I think the code below should help you towards acheiving your desired result.
Sub rename()
Dim wsMain As Worksheet, wsSum As Worksheet
Dim rng As Range
Set wsMain = Worksheets(1) 'dateneeded
Set wsSum = Worksheets(2) 'Campbells
wsMain.Name = Replace(wsMain.Range("D1"), "/", "") & " " & Left(wsMain.Range("B2"), 5)
For Each rng In wsSum.Range("A3:E3")
If wsMain.Range("D1") = rng.Value Then
col = rng.Column
Exit For
End If
Next rng
For n = 1 To wsMain.UsedRange.Rows.Count
wsSum.Cells(3 + n, col) = wsMain.Cells(1 + n, "F")
Next n
End Sub
Bookmarks