Copy Paste Multiple Worksheets w/ variable ranges into 1 master sheet vba code

Justin_G

New Member
Joined
Nov 13, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I created a workbook with multiple time cards (1 for each employee on different sheets). I need a vba code to copy and paste from each sheet into a compiled master sheet ("Data") The first line of data in each timecard sheet is in B8:H8. Some timecards could have a variable amount of lines from blank to 20 different lines of entry. If they are blank I need the code to skip that worksheet. The data needs to be pasted in the first empty row at the bottom of sheet ("Data"). Ideally I would like the code to do a cut and paste so the timecards are left blank once I run they code.

Each sheet with a time card ends in "_TC" so the code can include a variable to shorten it ...something like this

For Each Ws In Worksheets
If Ws.Name Like "*_TC" Then
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,223,889
Messages
6,175,226
Members
452,620
Latest member
dsubash

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