Copy Various Ranges from multiple workbooks to MASTER

Gravy2016

New Member
Joined
Aug 15, 2016
Messages
14
Hello,

You helped me solve many problems already. I found similar questions but I could not apply it to my issue.

I would appreciate any help or suggestions. I did review Macro to open each workbook and copy specific cell to master book with no luck. I pasted that code
VBA Code:
Sub CopySheet()
    Application.ScreenUpdating = False
    Dim FileName As Variant, wkbSource As Workbook, wkbDest As Workbook
    Set wkbDest = ThisWorkbook
    FileName = Application.GetOpenFilename("Excel Files (*.xls*),*.xls*", , "Select Excel Files", , True)
    If Not IsArray(FileName) Then
        MsgBox "No File Selected"
        Exit Sub
    End If
    For i = LBound(FileName) To UBound(FileName)
        Set wkbSource = Workbooks.Open(FileName(i))
        With wkbSource
            .Sheets("Source").Range("C6:AP" & .Range("C" & .Rows.Count).End(xlUp).Row).Copy
            wkbDest.Sheets("MASTER").Cells(wkbDest.Sheets("MASTER").Rows.Count, "C").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
            Application.CutCopyMode = False
            wkbSource.Close savechanges:=False
        End With
    Next i
    Application.ScreenUpdating = True
End Sub

I have 3 identically structured workbooks. Let’s say they are named A, B and C (All on my desktop). They are all .xlsx files

Each workbook is sent to me with specific ranges filled in. (see below ranges)

Each workbook has 5 identically named sheets but the information is unique.

I would like to copy the below ranges to “Master” (On my Desktop):

Workbook A Ranges: B22:G36 & B43:G51 & B58:G66 & B93:G107 & B114:G122 & B129:G137

Workbook B Ranges: B37:G40 & B52:G55 & B67:G68 & B108:G111 & B123:G126 & B138:G139

Workbook C Ranges: B41:G42 & B56:G57 & B69:G69 & B112:G113 & B127:G128 & B140:G140


I want to Paste all values (.PasteSpecial xlpasteValues)

Paste all values in workbook named “Master”. A workbook with 5 identical sheets. I assume I would run the code while "MASTER" is open

Thanks in advance for any help
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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