Try:
Sub jun22()
Dim x As String
Dim y As String
Dim z As String
Dim rng As Range
Dim i As Long
Dim ws As Worksheet
Set ws = Sheets("monthly")
ws.Activate
x = ws.Cells(1, "C").Value
y = ws.Cells(1, "D").Value
z = ws.Cells(1, "E").Value
For i = 3 To ws.Range("A" & Rows.count).End(3).Row Step 4
Set rng = Sheets(x).Rows(1).Find(Range("A" & i).Value, LookIn:=xlValues, Lookat:=xlWhole)
If Not rng Is Nothing Then
Sheets(x).Activate
Cells(2, rng.Column).Select
Do Until ActiveCell.Value <> ""
ActiveCell.offset(1).Select
Loop
ws.Range(Cells(i, "C"), Cells(i + 3, "C")).Value = Range(ActiveCell, ActiveCell.offset(3)).Value
End If
Set rng = Nothing
ws.Activate
Set rng = Sheets(y).Rows(1).Find(Range("A" & i).Value, LookIn:=xlValues, Lookat:=xlWhole)
If Not rng Is Nothing Then
Sheets(y).Activate
Cells(2, rng.Column).Select
Do Until ActiveCell.Value <> ""
ActiveCell.offset(1).Select
Loop
ws.Range(Cells(i, "D"), Cells(i + 3, "D")).Value = Range(ActiveCell, ActiveCell.offset(3)).Value
End If
Set rng = Nothing
ws.Activate
Set rng = Sheets(z).Rows(1).Find(Range("A" & i).Value, LookIn:=xlValues, Lookat:=xlWhole)
If Not rng Is Nothing Then
Sheets(z).Activate
Cells(2, rng.Column).Select
Do Until ActiveCell.Value <> ""
ActiveCell.offset(1).Select
Loop
ws.Range(Cells(i, "D"), Cells(i + 3, "D")).Value = Range(ActiveCell, ActiveCell.offset(3)).Value
End If
Set rng = Nothing
ws.Activate
Next i
End Sub
Bookmarks