Copy Column Range in Workbook to Data Worksheet in differnt file

linesy

Board Regular
Joined
Sep 27, 2004
Messages
72
Good morning all,

I have around 30 worksheets (all in the same workbook but not all the sheets in the said workbook) that I need to copy 1 column range (C11:C90) in each of these tabs into a new file (ProdData.xlsm) Sheet "Qtr" at "C11" and then the next subsequent column ("D11, E11" etc.)

I recorded a macro, but it's HUGE and very ugly. Any help would be appreciated.

Thanks and have a wonderful day.

Susan
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Possibly...
Code:
Sub NotTested()
    Dim WBDest As Workbook
    Dim WSDest As Worksheet
    Dim WS As Worksheet
    Dim lCol As Long
    
    Set WBDest = Workbooks("ProdData.xlsm")
    Set WSDest = WB.Worksheets("Qtr")
    
    For Each WS In ThisWorkbook
        if ws = 'CRITERIA FOR COPYING DATA FROM A WORKSHEET' Then
            lCol = WSDest.Cells(11, WSDest.Columns.Count).End(xlLeft).Column
            WS.Range("C11:C90").Copy WSDest.Cells(11, lCol)
        End If
    Next WS
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,122
Members
452,381
Latest member
Nova88

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