Hi Everyone..
I have a workbook named "Klaus", with a number of worksheets.. The first sheet it named "Ark" further I have a number of other worksheets with the same structure as shown here: (The solumns are A to C..)
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Year[/TD]
[TD]Weight[/TD]
[/TR]
[TR]
[TD]134[/TD]
[TD]2004[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]2004[/TD]
[TD]17[/TD]
[/TR]
[TR]
[TD]543[/TD]
[TD]2004[/TD]
[TD]13[/TD]
[/TR]
[TR]
[TD]247[/TD]
[TD]2004[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]364[/TD]
[TD]2004[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]357[/TD]
[TD]2004[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]853[/TD]
[TD]2004[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]245[/TD]
[TD]2004[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]864[/TD]
[TD]2004[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2467[/TD]
[TD]2004[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]542[/TD]
[TD]2004[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]2580[/TD]
[TD]2004[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
What I want is a macro that loops through all the worksheets (Except the first one) and copies data from the other worksheets into "Ark". I want data from all three columns copied in BUT, I only want a certain number of rows.. The sum of the first 5 cells from the top of column C is 72.. So lets say that I have in some cell have the value 70, then I want the macro to copy the range Range("A2:C6") into "Ark", so the minimum range of cells across the three columns, where the sum from C2 and downwards is larger than 70 (in this example). Then I want the macro to go on to the next worksheet and do the same (with the same value (70)), but copy the cells in extension of the previously inserted cells in "Ark"..
Hope it makes sense and please dont hesitate the ask clarifying questions
So far I have this code..
I am using Windows 7 and Excel 2013.
Any help is greatly appreciated!
I have a workbook named "Klaus", with a number of worksheets.. The first sheet it named "Ark" further I have a number of other worksheets with the same structure as shown here: (The solumns are A to C..)
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Year[/TD]
[TD]Weight[/TD]
[/TR]
[TR]
[TD]134[/TD]
[TD]2004[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]2004[/TD]
[TD]17[/TD]
[/TR]
[TR]
[TD]543[/TD]
[TD]2004[/TD]
[TD]13[/TD]
[/TR]
[TR]
[TD]247[/TD]
[TD]2004[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]364[/TD]
[TD]2004[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]357[/TD]
[TD]2004[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]853[/TD]
[TD]2004[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]245[/TD]
[TD]2004[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]864[/TD]
[TD]2004[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2467[/TD]
[TD]2004[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]542[/TD]
[TD]2004[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]2580[/TD]
[TD]2004[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
What I want is a macro that loops through all the worksheets (Except the first one) and copies data from the other worksheets into "Ark". I want data from all three columns copied in BUT, I only want a certain number of rows.. The sum of the first 5 cells from the top of column C is 72.. So lets say that I have in some cell have the value 70, then I want the macro to copy the range Range("A2:C6") into "Ark", so the minimum range of cells across the three columns, where the sum from C2 and downwards is larger than 70 (in this example). Then I want the macro to go on to the next worksheet and do the same (with the same value (70)), but copy the cells in extension of the previously inserted cells in "Ark"..
Hope it makes sense and please dont hesitate the ask clarifying questions

So far I have this code..
Code:
Sub codesofar()
Application.ScreenUpdating = False
Dim ark As Worksheet
Set ark = Worksheets(1)
For Each ws In Workbook
If ws.Name <> "Ark" Then
'HELP! ;)
End If
Next ws
End Sub
I am using Windows 7 and Excel 2013.
Any help is greatly appreciated!
