You set WS as Worksheets("Quant Sheet") , but then use the same WS variable that will be used in your loop. This can cause problems.
Try the following:
Dim ws As Worksheet, mainWS As Worksheet Dim x As Integer, y As Integer, a As Integer, b As Integer Set mainWS = Worksheets("Quant Sheet") x = 1 y = 3 a = 3 b = 2 For Each ws In ActiveWorkbook.Worksheets If (ws.Name <> "Quant Sheet") Then ws.Range("A3").Copy Destination:=mainWS.Cells(y, 1) y = y + 1 End If Next ws
Basically, you want to avoid using .Select / .Activate to make sure you work more directly with the data.
Edit: FYI, you can most likely make it more dynamic without using something like y=y+1 and instead use the offset or lastRow variable, but this is a personal preference, as it will do the same thing. (I also assume that the variables x , a and b are used elsewhere in your macro ...
Brucewayne
source share