Stack data in one column from multiple sheets

NateD1

New Member
Joined
Apr 1, 2020
Messages
46
Office Version
  1. 365
Platform
  1. Windows
Hi i need some help with creating a code to do the below if possible.

I need to copy data from "Column H" (excluding top row header). from multiple sheets in the same workbook (all the data layouts are the same except for 2 sheets), for this example i need data from "H" in sheet numbers 3,4,5,6,7,8,9,10. however exclude copying data from sheets 11 and 12 as the data is different on those two sheets. then i need all the data copied and stacked into column B in sheet named "Summary" (sheet1)

thanks in advanced
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
You can probably do this with Excel functions. Do you require VBA?
 
Upvote 0
You can probably do this with Excel functions. Do you require VBA?
Was looking for a way as an import button option when new data is added.
I have found the below code which seems to work.

VBA Code:
Sub CopyData()
Dim ws  As Worksheet, _
    LR1 As Long, _
    LR2 As Long
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
'sheets to ignore 
    If ws.Name <> "Summary" And ws.Name <> "Import" Then
        LR1 = Sheets("Summary").Range("A" & Rows.Count).End(xlUp).Row + 1
        LR2 = ws.Range("A" & Rows.Count).End(xlUp).Row
'Range to be copied 
        ws.Range("I2:I" & LR2).Copy Destination:=Sheets("Summary").Range("A" & LR1)
    End If
Next ws

Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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
Back
Top