Copy & Pasting Data Into New Sheet

ai1094

Board Regular
Joined
Aug 23, 2018
Messages
92
Hi,

I have a simple ask. I have an excel workbook that is broken up into 3 different sheets. I would like to have a VBA code that lets me take all those 3 sheets and consolidate it into one sheet. All column fields are the same, they are just broken into 3 different regions. However, sometimes there can be more/less entries so I need the VBA code to find the last row containing data.

How would I do this? Thanks.
 
Originally no, but because my current macro isn't working for the other user I have to resolve to an alternative method, which is copying and pasting the information from the sheets into the master file.

So in this case, yes, I intend to always have the master file blank until the 3 sheets are refreshed and ready to be copied over
 
Upvote 0

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.
In that case we can go back to the first code I supplied, with a slight mod.
Code:
Sub ai1094()
   Dim i As Long
   
   Sheets("Master File").Delete
   Sheets(1).Copy Sheets(1)
   ActiveSheet.Name = "Master File"
   For i = 3 To Worksheets.Count
      With Sheets(i)
         .Rows("2:" & .Range("A" & Rows.Count).End(xlUp).Row).Copy Range("A" & Rows.Count).End(xlUp).Offset(1)
      End With
   Next i
End Sub
 
Upvote 0
Okay, I am still having some issues, but the important thing is you provided me the code I needed. I will play around with it some more to see if I can figure it out on my own. Thanks so much Fluff, you never let me down!
 
Upvote 0
You're welcome & thanks for the feedback.
You know where to come if you have any problems :)
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,742
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