This code basically checks a cell for the current date and then fills out the report by finding that date and placing the correct values in the correct places. It works fine I just know that I am going to need to build something similar for many other reports so I am hoping to update, streamline and improve in any way I can.
Sub Copy_Data()
Dim Data As Worksheet
Set Data = ThisWorkbook.Worksheets("Data")
Dim Turnover2017 As Worksheet
Set Turnover2017 = ThisWorkbook.Worksheets("2017 Turnover") '*************** Edit Year Number here upon creation of next year's tab
Dim FindDate As Date
FindDate = Data.Range("FindDate").Value
Dim HCRNG As Range
Dim NTRNG As Range
Dim PTRNG As Range
Dim X As Integer
Dim HCNUM As Integer
Dim NTNUM As Integer
Dim PTNUM As Integer
For X = 1 To 11
'******* This block scoops data from the Data tab
HCNUM = Data.Range("B2").Offset(X, 0).Cells.Value
NTNUM = Data.Range("C2").Offset(X, 0).Cells.Value
PTNUM = Data.Range("D2").Offset(X, 0).Cells.Value
With Turnover2017.Range("A:AM") '*************** Edit Year Number here upon creation of next year's tab
Set HCRNG = .Find(What:=(FindDate), _
After:=Range("A1"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
HCRNG.Offset(X, 2).Cells.Value = HCNUM '******** This updates the appropriate column based on the date determined in Data G2 aka. range "FindDate"
HCRNG.Offset(X + 15, 2).Cells.Value = HCNUM '******** This updates the appropriate column based on the date determined in Data G2 aka. range "FindDate"
End With
With Turnover2017.Range("A:AM") '*************** Edit Year Number here upon creation of next year's tab
Set NTRNG = .Find(What:=(FindDate), _
After:=Range("A18"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
NTRNG.Offset(X, 1).Cells.Value = NTNUM '******** This updates the appropriate column based on the date determined in Data G2 aka. range "FindDate"
End With
With Turnover2017.Range("A:AM") '*************** Edit Year Number here upon creation of next year's tab
Set PTRNG = .Find(What:=(FindDate), _
After:=Range("A1"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
PTRNG.Offset(X, 1).Cells.Value = PTNUM '******** This updates the appropriate column based on the date determined in Data G2 aka. range "FindDate"
End With
Next X
End Sub