There’s way more to this concept, but here’s a teaser.
Sub fillMonth(dDate As Date)
Dim iRow As Integer, iColumn As Integer, sColumn As String, iDays As Integer, iWeekRow As Integer, iMonth As Integer
Dim mHours As Long, mDays As Long
Sheets(“Month”).Select
‘reset stuff
Range(“A2:G37”).ClearContents
Range(“K7”).Value = 0
Range(“K8”).Value = 0
Range(“K9”).Value = 0
iRow = ActiveCell.Row
Sheets(“Month”).Select
iMonth = Month(dDate)
iWeekRow = 2
iNoteRow = 10
mHours = 0
mDays = 0
lHours = 0
Dim lNorlab As Double, lDSHome As Double, lBank As Double
Do While Month(dDate) = iMonth
iDays = Weekday(dDate, vbSunday)
Sheets(“Month”).Select
sColumn = ConvertToLetter(iDays)
Range(sColumn & CStr(iWeekRow + 0)).Value = Format(dDate, “dddd”)
Range(sColumn & CStr(iWeekRow + 1)).Value = Format(dDate, “dd-mmm-yyyy”)
lHours = 0
Sheets(“Time”).Select
Columns(“A:A”).Select
If Not IsDate(dDate) Then dDate = Sheets(“Time”).Range(“A2”).Value
Selection.Find(What:=dDate, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
iRow = ActiveCell.Row
lHours = Range(“I” & CStr(iRow)).Value + lHours
Sheets(“Month”).Select
Range(sColumn & CStr(iWeekRow + 2)).Value = lHours
iDays = iDays + 1
If iDays = 8 Then
iDays = 1
iWeekRow = iWeekRow + 3
End If
dDate = dDate + 1
iRow = iRow + 1
Loop
Sheets(“Month”).Select
‘Set Runner
Dim mrow As Long, thisMonth As String
dDate = DateAdd(“m”, -1, dDate)
sDate = CStr(Format(dDate, “dd-mmm-yyyy”))
Sheets(“Runner”).Select
Dim aCell As Range
Range(“A3:A99”).Select
Set aCell = Range(“A3:A99”).Find(What:=CDate(sDate), After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not aCell Is Nothing Then
mrow = aCell.Row
Else
mrow = 0
End If
If mrow < 3 Then
Range("A3").Select
If Range("A3").Value = "" Then
mrow = 3
Else
Selection.End(xlDown).Select
mrow = ActiveCell.Row + 1
End If
End If
Range("B" & CStr(mrow)).Value = Sheets("Month").Range("K4").Value
Range("C" & CStr(mrow)).Value = Sheets("Month").Range("L4").Value
'Update Weekly Time Sheets for current week
Sheets("Month").Select
Range("A2:G33").Select
dDate = Format(Now(), "dd-mmm-yyyy")
If Month(Range("G1").Value) Month(dDate) Then dDate = Range("G1").Value
Selection.Find(What:=dDate, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
iRow = ActiveCell.Row
dDate = DateAdd("D", 7 – Weekday(dDate), dDate)
'return to Month tab
Sheets("Month").Select
Range("A" & CStr(mrow)).Select
End Sub