Copying Columns

mansoor2840

New Member
Joined
Sep 25, 2014
Messages
11
Dear All,
i have 10 worksheet in a workbook which i update regularly i want a have new sheet where colA and colE are copied from 8 worksheet out of 10.
Thanks in advance for your help.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
What are the names of the 2 sheets that you don't want to copy? What is the name of the new sheet? Do you want the columns from each sheet copied underneath each other in column A and column B of the new sheet?
 
Upvote 0
Sheet1 to sheet8 to be copied to sheet 11 yes the data should be below each other that is sheet1 colA followed by sheet1 colA. And sheet 1 ColE to followed by sheet2 ColE Sheet9 and sheet 10 not be copied.
 
Upvote 0
Try:
Code:
Sub copyCols()
    Application.ScreenUpdating = False
    Dim LastRow As Long, x As Long
    LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    For x = 1 To 8
        With Sheets(x)
            LastRow = .Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
            .Range("A1:A" & LastRow).Copy Sheets(11).Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
            .Range("E1:E" & LastRow).Copy Sheets(11).Cells(Rows.Count, "E").End(xlUp).Offset(1, 0)
        End With
    Next x
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Thanks for code
i have sheet names as product names so how to use the code
for example: sheet 1 - hamm, sheet 2 - schwing
 
Upvote 0
What are the names of the 8 sheets you want to copy?
 
Upvote 0
That's 3 sheets. I thought you said you wanted to copy from 8 sheets. Please clarify.
 
Upvote 0
Try:
Code:
Sub copyCols()
    Application.ScreenUpdating = False
    Dim LastRow As Long, ws As Worksheet
    For Each ws In Sheets(Array("hamm", "viegele", "paver")) '[COLOR="#FF0000"]add additional sheets if necessary[/COLOR]
        With ws
            LastRow = .Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
            .Range("A1:A" & LastRow).Copy Sheets(11).Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
            .Range("E1:E" & LastRow).Copy Sheets(11).Cells(Rows.Count, "E").End(xlUp).Offset(1, 0)
        End With
    Next ws
    Application.ScreenUpdating = True
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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