Greetings,
Could you please elaborate what range would you like to pass from Client1 to US ws for example?
I assume you want it to loop from finNumb = 3 until finNumb = 7 to the respective ws?
Also, i made a couple of changes:
Sub Compile2()
Dim sh As Worksheet
Dim UKsh As Worksheet, EUsh As Worksheet, USsh As Worksheet
Dim EUrow As Long, UKrow As Long, USrow As Long
Dim FinNum As Integer
EUrow = 2
UKrow = 2
USrow = 2
Set UKsh = Sheets("UK")
Set EUsh = Sheets("EU")
Set USsh = Sheets("US")
For Each sh In Worksheets
FinNum = 3
Do
If sh.Range("A60").Value = "EU" Then
sh.Range("B5").Copy EUsh.Range("A" & EUrow)
sh.Range(Cells(8, FinNum), Cells(48, FinNum)).Copy EUsh.Range("B" & EUrow)
EUrow = EUrow + 1
ElseIf sh.Range("A60").Value = "UK" Then
sh.Range("B5").Copy UKsh.Range("A" & UKrow)
sh.Range(Cells(8, FinNum), Cells(48, FinNum)).Copy UKsh.Range("B" & UKrow)
UKrow = UKrow + 1
ElseIf sh.Range("A60").Value = "US" Then
sh.Range("B5").Copy USsh.Range("A" & USrow)
sh.Range(Cells(8, FinNum), Cells(48, FinNum)).Copy USsh.Range("B" & USrow)
USrow = USrow + 1
End If
FinNum = FinNum + 1
Do Until FinNum > 7
Application.CutCopyMode = False
Loop
Loop
Next
End Sub
No more compile error, but I don't understand the "Do Until FinNum > 7" part.
Regards,
Daniel
Bookmarks