Set ws3 = ThisWorkbook.Worksheets("Sheet3")
Set ws1 = ThisWorkbook.Worksheets("Sheet1")
Set ws2 = ThisWorkbook.Worksheets("Sheet2")
Set ws4 = ThisWorkbook.Worksheets("Sheet4")
Dim lastrow, lastrow2, LastrowF, LastrowC As Long
lastrow = ws4.Cells(ws4.Rows.Count, "M").End(xlUp).Row
LastrowD = ws3.Cells(ws3.Rows.Count, "M").End(xlUp).Row + 5
lastrow2 = ws3.Cells(ws3.Rows.Count, "M").End(xlUp).Row
Dim FilterRange, PasteRange As Range
Set FilterRange = ws3.Range("M2:M" & lastrow2)
Set PasteRange = ws3.Range("M" & LastrowD)
FilterRange.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=FilterRange, CopyToRange:=PasteRange, Unique:=True
Selection.End(xlDown).Select
ws3.Select
Range("M" & LastrowD).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Cut
ws4.Select
ws4.Range("E3").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ws3.Select
Range("M" & LastrowD).Select
Range(Selection, Selection.End(xlDown)).ClearContents
Dim LastRowE As Long
LastRowE = ws4.Cells(wsW.Rows.Count, "E").End(xlUp).Row
Dim lColumn As Long
lColumn = ws2.Cells(2, wsC.Columns.Count).End(xlToLeft).Column + 1
ws4.Range("E4:E" & LastRowE).Copy
ws2.Cells(2, lColumn).PasteSpecial xlPasteValues, Transpose:=True
Application.CutCopyMode = False
ws2.Select
Columns("L:N").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("T:V").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("S:T").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
LastrowC = ws2.Cells(ws2.Rows.Count, "A").End(xlUp).Row
Range("L2") = "XXXX"
Range("L3:L" & LastrowC).Formula = "month(k3)”
Columns("L:L").Select
Selection.NumberFormat = "0"