Hello all
I am sorry I am a VBA beginner and it is also my first post here.
So here is what I am trying to achieve:
I need to copy and paste the data from a spreadsheet (Sheet2) into a main one (Sheet1). However, once I finished to copy the data from Sheet2, I need to do the same exercise but from Sheet3, then Sheet4 and etc...
So far, this is where I am. It works but I still cannot get my head around the transition into different spreadsheets...
If you could help me this would be amazing.
Thank you,
Sub Loop2()
'Have x start at row2
x = 2
'Loop until a blank row is found
Do While ThisWorkbook.Sheets("sheet2").Cells(x, 2).Value <> ""
'This will copy data from Page2 in Page1
ThisWorkbook.Sheets("sheet2").Range("A:C").Copy ThisWorkbook.Sheets("sheet1").Range("A:C")
x = x + 1
Loop
End Sub
I am sorry I am a VBA beginner and it is also my first post here.
So here is what I am trying to achieve:
I need to copy and paste the data from a spreadsheet (Sheet2) into a main one (Sheet1). However, once I finished to copy the data from Sheet2, I need to do the same exercise but from Sheet3, then Sheet4 and etc...
So far, this is where I am. It works but I still cannot get my head around the transition into different spreadsheets...
If you could help me this would be amazing.
Thank you,
Sub Loop2()
'Have x start at row2
x = 2
'Loop until a blank row is found
Do While ThisWorkbook.Sheets("sheet2").Cells(x, 2).Value <> ""
'This will copy data from Page2 in Page1
ThisWorkbook.Sheets("sheet2").Range("A:C").Copy ThisWorkbook.Sheets("sheet1").Range("A:C")
x = x + 1
Loop
End Sub