Results 1 to 2 of 2

Copy Data from Same Cell in Multiple Sheets to One Column on Summary Sheet

Threaded View

  1. #1
    Registered User
    Join Date
    01-19-2023
    Location
    USA
    MS-Off Ver
    365 Version 2212
    Posts
    1

    Post Copy Data from Same Cell in Multiple Sheets to One Column on Summary Sheet

    Hey y'all!

    I use a software that automatically generates spreadsheets using a fixed template. I use a separate macro to merge the individual sheets into a master workbook, which already has a summary sheet in it. The summary sheet has indirect formulas that reference data I manually input on the same sheet in order to locate the appropriate sheet to pull from. I'm trying to prevent having to enter any data manually, because it wastes a lot of time when I know VBA can do it. I've included the merge & sheet rename macro code in the workbook & feel free to copy it for personal use if you want it!

    I'm having issues getting the macro to loop through the worksheets and copy the cell value from each sheet, and add them into a column in order of the sheet's index number, stopping when there are no more sheets.

    Basically, I need Merged1!B2 to be copied to Summary!B2, Merged2!B2 to be copied to Summary!B3, and so on and so forth. I'm pretty sure using R1C1 form is going to be easier for the macro, I'm just not as familiar with it as A1. I can't use a 3D Dynamic formula, because I don't know the sheet names or how many there are until I've merged the book together. I have a static "start" sheet, but no "end".



    Sub OrderName()
    
        Dim SummarySheet As Worksheet
        Dim ws As Worksheet
        Dim i As Integer
    
        Set SummarySheet = ThisWorkbook.Worksheets(1)
        Set ws = ThisWorkbook.Worksheets.Count
        
        For i = 2 To SummarySheet.Range("B2:B" & SummarySheet.Range("B2").End(xlDown).Row).Cells.Count + 2
        
            ws.Range("B2").Copy Destination:=SummarySheet.Cells(B2)
            
        Next
        
    End Sub
    Where SummarySheet is the sheet I need the data copied to, which is first in the workbook and already there when the sheets are merged into it. ws is the worksheet I need the data from, and B2 is the data location that's the same across all the sheets (except the Summary sheet).
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. copy data from multiple sheets to sheet summary vertically
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-03-2021, 08:32 AM
  2. Copy Data from Same Cell on Several Sheets to a Summary Sheet
    By necht_angel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-25-2019, 11:58 AM
  3. Summary sheet to refer to cell on multiple sheets (always same column, but row# can vary)
    By carlito2002wgn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-12-2019, 10:04 PM
  4. Replies: 1
    Last Post: 12-20-2013, 07:05 AM
  5. Replies: 2
    Last Post: 10-08-2013, 02:58 PM
  6. [SOLVED] Summary sheet - copy cell contents from multiple sheets to one summary sheet
    By jsmity in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2013, 10:32 AM
  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