+ Reply to Thread
Results 1 to 3 of 3

Copy range from multiple sheets into one sheet column to column

  1. #1
    Registered User
    Join Date
    04-05-2021
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    4

    Copy range from multiple sheets into one sheet column to column

    Probably there's a lot of same questions regarding this but this is my first day with VBA and I'm unsure of how it works.

    I recorded a macro of what I'm trying to do, I want it to apply to all sheets in the workbook.

    I want to copy a few ranges for example M6:M11 and paste it into the Mastersheet, and repeat the process but pasting on the next column instead of the row below it.

    I tried using this but this makes it paste in the same column

    Sub MM1()
    Dim ws As Worksheet, lr As Long
    lr = Sheets("Master").Cells(Rows.Count, "A").End(xlUp).Row + 1
    For Each ws In Worksheets
    If ws.Name <> "Master" Then
    ws.Range("A7:K16").Copy Sheets("Master").Range("A" & lr)
    lr = Sheets("Master").Cells(Rows.Count, "A").End(xlUp).Row + 1
    End If
    Next ws
    End Sub



    This is the recorded macro of what I'm trying to do.

    Sub Macro1()
    '
    ' Macro1 Macro
    '

    '
    Sheets("31 Dec").Select
    Range("M6:M11").Select
    Selection.Copy
    Sheets("Master").Select
    ActiveSheet.Paste
    Range("B1").Select
    Sheets("1 Jan").Select
    Range("M6:M11").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Master").Select
    ActiveSheet.Paste
    Range("C1").Select
    Sheets("2 Jan ").Select
    Range("M6:M11").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Master").Select
    ActiveSheet.Paste
    Range("D1").Select
    End Sub

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Copy range from multiple sheets into one sheet column to column

    Try

    Please Login or Register  to view this content.
    Kind regards
    Leo

  3. #3
    Registered User
    Join Date
    04-05-2021
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    4

    Re: Copy range from multiple sheets into one sheet column to column

    Thanks a lot Leo, This works perfectly!!
    Apparently I had an issue with this part, the pasting to master sheet.

    ws.Range("M6:M11").Copy Sheets("Master").Cells(1, Columns.Count).End(xlToLeft).Offset(, 1)

    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] copy data from multiple sheets to master sheet and insert column to get value
    By MKLAQ in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 03-06-2021, 05:29 AM
  2. Copy last column from multiple sheets to a master sheet
    By TallOne in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-11-2020, 03:37 PM
  3. Replies: 9
    Last Post: 03-28-2017, 08:30 PM
  4. [SOLVED] Search for a column across multiple sheets and copy them in 1st sheet.
    By gauti14 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-20-2017, 04:41 PM
  5. Replies: 10
    Last Post: 02-20-2014, 04:09 PM
  6. [SOLVED] Copy Rows to sheet if column value >40, multiple sheets
    By rlowe in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-04-2013, 06:08 PM
  7. macro to copy column A from multiple sheets onto summary sheet
    By fabrecass in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2012, 05:46 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1