Forum Discussion

Rory123908's avatar
Rory123908
Copper Contributor
Dec 03, 2021

Merging Sheets Using VBA

Hi there, I'm looking to implement a macro that means that I will be able to merge 2 sheets into a new sheet, for all rows that match in my time columns. Basically I have 2 sheets, each with a time column in column A. I want to copy all of the rows in both sheets that have the same time and put them all together in sheet 3. I have uploaded an example of my problem, would anybody be able to help with this? Many thanks! P.s I understand this can be done with power query, but I really do need this done with VBA!

5 Replies

  • Donald_Genes's avatar
    Donald_Genes
    Brass Contributor

    Rory123908 

     

    I have a VBA code that does that, i shall help you

    Let me download the excel file and do it and send it back to you

      • Donald_Genes's avatar
        Donald_Genes
        Brass Contributor

        Rory123908 Done! i created a new sheet called it data, so i can use vba to combine them based on their matching rows, and i told VBA to create a new column at the end to indicate the sheet names, like sheet1 and sheet 2

Resources