Consolidate multiples rows in one sheet

Goalexcel

Board Regular
Joined
Dec 28, 2020
Messages
95
Office Version
  1. 2016
Platform
  1. Windows
Hello Expert Team
Please kindly give me some help, multiples sheets need to copy in one sheet name Report. I am using below code but it's not copy. My excel file contained sheet 1 until sheet 8, column A and Column B rows always change the data.

Sub Consolidate()

Dim i As Integer

For i = 1 to Worksheets.Count = 1

Worksheets(1).Select
Range("A1").Select
Range(Selection, Selection.End(x1Down)).Select
Range(Selection, Selection.End(x1TopRight)).Select
Selection.Copy

Worksheets("Report").Select
Range("A1048576").Select
Selection.End(x1Up).Select
ActiveCell.Offset(1,0).Select
ActiveSheet.Paste

Next i

End sub

Please check below attach, sheet start 1 until sheet 8, usually will be change the number of sheets.

1636076969971.png


See sheet report

1636077061503.png
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,179
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
MAybe this way
VBA Code:
Sub MM1()
Dim i As Integer, n As Integer
n = 1
For i = 1 To 8
    With Sheets("Sheet" & i)
        .Range("A:B").Copy
        Sheets("Report").Cells(1, n).Insert
    End With
n = n + 2
Next i
End Sub
 
Solution

Goalexcel

Board Regular
Joined
Dec 28, 2020
Messages
95
Office Version
  1. 2016
Platform
  1. Windows
MAybe this way
VBA Code:
Sub MM1()
Dim i As Integer, n As Integer
n = 1
For i = 1 To 8
    With Sheets("Sheet" & i)
        .Range("A:B").Copy
        Sheets("Report").Cells(1, n).Insert
    End With
n = n + 2
Next i
End Sub
Thank you so much Mr. Michael for your excellent and fastest assistance. All the best wishes for the Expert Professional Comunity.
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,179
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
Glad to help...(y):cool:
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,837
Messages
5,766,721
Members
425,373
Latest member
ndiejennrrd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top