It is because of the formula references in each sheet. We can make a simple change from pasteall to pastevalues. I believe that may correct it (Note: It is pulling data in column AE and every column to the right)
Sub Copy_Data()
Dim fWS As Worksheet: Set fWS = Sheets("Statatest")
Dim ws1 As Worksheet: Set ws1 = Sheets("Productivity")
Dim ws As Worksheet
Dim iCol As Long, LC As Long, LR As Long, aCount As Long
Application.ScreenUpdating = False
For Each ws In Worksheets
Select Case ws.Name
Case Is = fWS.Name
'do nothing
Case Is = ws1.Name
aCount = 3
ws1.Range("B6:B" & ws1.Range("B" & Rows.Count).End(xlUp).Row).Copy
fWS.Range("C1").PasteSpecial xlPasteAll, Transpose:=True
LC = ws1.Cells(10, Columns.Count).End(xlToLeft).Column
If LC > 1 Then
For iCol = 3 To LC
LR = ws1.Cells(Rows.Count, iCol).End(xlUp).Row
ws1.Range(ws1.Cells(10, iCol), ws1.Cells(LR, iCol)).Copy
fWS.Range("C" & aCount).PasteSpecial xlPasteValues, Transpose:=True
aCount = aCount + 5
Next iCol
End If
Case Is = "Terms of Trade"
aCount = 4
LC = ws.Cells(10, Columns.Count).End(xlToLeft).Column
If LC > 30 Then
For iCol = 31 To LC
LR = ws.Cells(Rows.Count, iCol).End(xlUp).Row
ws.Range(ws.Cells(10, iCol), ws.Cells(LR, iCol)).Copy
fWS.Range("C" & aCount).PasteSpecial xlPasteValues, Transpose:=True
aCount = aCount + 5
Next iCol
End If
Case Is = "Debt"
aCount = 2
LC = ws.Cells(10, Columns.Count).End(xlToLeft).Column
If LC > 30 Then
For iCol = 31 To LC
LR = ws.Cells(Rows.Count, iCol).End(xlUp).Row
ws.Range(ws.Cells(10, iCol), ws.Cells(LR, iCol)).Copy
fWS.Range("C" & aCount).PasteSpecial xlPasteValues, Transpose:=True
aCount = aCount + 5
Next iCol
End If
Case Is = "REER"
aCount = 5
LC = ws.Cells(10, Columns.Count).End(xlToLeft).Column
If LC > 30 Then
For iCol = 31 To LC
LR = ws.Cells(Rows.Count, iCol).End(xlUp).Row
ws.Range(ws.Cells(10, iCol), ws.Cells(LR, iCol)).Copy
fWS.Range("C" & aCount).PasteSpecial xlPasteValues, Transpose:=True
aCount = aCount + 5
Next iCol
End If
Case Is = "FX"
aCount = 6
LC = ws.Cells(10, Columns.Count).End(xlToLeft).Column
If LC > 30 Then
For iCol = 31 To LC
LR = ws.Cells(Rows.Count, iCol).End(xlUp).Row
ws.Range(ws.Cells(10, iCol), ws.Cells(LR, iCol)).Copy
fWS.Range("C" & aCount).PasteSpecial xlPasteValues, Transpose:=True
aCount = aCount + 5
Next iCol
End If
End Select
Next ws
Application.ScreenUpdating = True
End Sub
Bookmarks