Fiveshorter
New Member
- Joined
- Jul 14, 2017
- Messages
- 18
Hi,
I was wondering if anyone can helop me build a macro for a report i do every day. I have a master file that has multiple sheets. Every day i copy and paste some of these sheets into a new workbook.
In my master file i am only concerned about 3 sheets, MasterF, Customer, Country. I copy and paste customer into a new sheet and country into a new sheet (i only copy and paste the data to keep file size down). For my masterF file there are multiple filters, the data is in a standard table with standard filters on it. I filter my column entitled "Complete" to just yes and filter country to just "UK" then copy and paste the data into a new sheet (copying the data to keep file size down). Then i go back into the masterF file and unfilter. Then i filter the "complete" column to just "NO", country column to USA and NAME column to all except NOT AVAILABLE.
Result :
MasterF (A)
[TABLE="width: 500"]
<tbody>[TR]
[TD]CustID[/TD]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Order ID[/TD]
[TD]Complete[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Tim[/TD]
[TD]UK[/TD]
[TD]67[/TD]
[TD]YES[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Daenerys[/TD]
[TD]UK[/TD]
[TD]190[/TD]
[TD]YES[/TD]
[TD]6[/TD]
[/TR]
</tbody>[/TABLE]
MasterF (B)
[TABLE="width: 500"]
<tbody>[TR]
[TD]CustID[/TD]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Order ID[/TD]
[TD]Complete[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Emma[/TD]
[TD]USA[/TD]
[TD]54[/TD]
[TD]NO[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
Country
[TABLE="width: 500"]
<tbody>[TR]
[TD]Cust ID[/TD]
[TD]Country[/TD]
[/TR]
[TR]
[TD]123124[/TD]
[TD]USA[/TD]
[/TR]
[TR]
[TD]45353[/TD]
[TD]UK[/TD]
[/TR]
</tbody>[/TABLE]
Customer
[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 500"]
<tbody>[TR]
[TD]Cust ID[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]6543[/TD]
[TD]Damian[/TD]
[/TR]
[TR]
[TD]7645[/TD]
[TD]David[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Sheets in Master excel Sheet
Customer sheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Cust ID[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]6543[/TD]
[TD]Damian[/TD]
[/TR]
[TR]
[TD]7645[/TD]
[TD]David[/TD]
[/TR]
</tbody>[/TABLE]
Country sheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Cust ID[/TD]
[TD]Country[/TD]
[/TR]
[TR]
[TD]123124[/TD]
[TD]USA[/TD]
[/TR]
[TR]
[TD]45353[/TD]
[TD]UK[/TD]
[/TR]
</tbody>[/TABLE]
MasterF sheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]CustID[/TD]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Order ID[/TD]
[TD]Complete[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Jon[/TD]
[TD]USA[/TD]
[TD]34[/TD]
[TD]YES[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Emma[/TD]
[TD]USA[/TD]
[TD]54[/TD]
[TD]NO[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Tim[/TD]
[TD]UK[/TD]
[TD]67[/TD]
[TD]YES[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Sansa[/TD]
[TD]UK[/TD]
[TD]78[/TD]
[TD]NO[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Daenerys[/TD]
[TD]UK[/TD]
[TD]190[/TD]
[TD]YES[/TD]
[TD]6
[/TD]
[/TR]
</tbody>[/TABLE]
I was wondering if anyone can helop me build a macro for a report i do every day. I have a master file that has multiple sheets. Every day i copy and paste some of these sheets into a new workbook.
In my master file i am only concerned about 3 sheets, MasterF, Customer, Country. I copy and paste customer into a new sheet and country into a new sheet (i only copy and paste the data to keep file size down). For my masterF file there are multiple filters, the data is in a standard table with standard filters on it. I filter my column entitled "Complete" to just yes and filter country to just "UK" then copy and paste the data into a new sheet (copying the data to keep file size down). Then i go back into the masterF file and unfilter. Then i filter the "complete" column to just "NO", country column to USA and NAME column to all except NOT AVAILABLE.
Result :
MasterF (A)
[TABLE="width: 500"]
<tbody>[TR]
[TD]CustID[/TD]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Order ID[/TD]
[TD]Complete[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Tim[/TD]
[TD]UK[/TD]
[TD]67[/TD]
[TD]YES[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Daenerys[/TD]
[TD]UK[/TD]
[TD]190[/TD]
[TD]YES[/TD]
[TD]6[/TD]
[/TR]
</tbody>[/TABLE]
MasterF (B)
[TABLE="width: 500"]
<tbody>[TR]
[TD]CustID[/TD]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Order ID[/TD]
[TD]Complete[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Emma[/TD]
[TD]USA[/TD]
[TD]54[/TD]
[TD]NO[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
Country
[TABLE="width: 500"]
<tbody>[TR]
[TD]Cust ID[/TD]
[TD]Country[/TD]
[/TR]
[TR]
[TD]123124[/TD]
[TD]USA[/TD]
[/TR]
[TR]
[TD]45353[/TD]
[TD]UK[/TD]
[/TR]
</tbody>[/TABLE]
Customer
[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 500"]
<tbody>[TR]
[TD]Cust ID[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]6543[/TD]
[TD]Damian[/TD]
[/TR]
[TR]
[TD]7645[/TD]
[TD]David[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Sheets in Master excel Sheet
Customer sheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Cust ID[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]6543[/TD]
[TD]Damian[/TD]
[/TR]
[TR]
[TD]7645[/TD]
[TD]David[/TD]
[/TR]
</tbody>[/TABLE]
Country sheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Cust ID[/TD]
[TD]Country[/TD]
[/TR]
[TR]
[TD]123124[/TD]
[TD]USA[/TD]
[/TR]
[TR]
[TD]45353[/TD]
[TD]UK[/TD]
[/TR]
</tbody>[/TABLE]
MasterF sheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]CustID[/TD]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Order ID[/TD]
[TD]Complete[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Jon[/TD]
[TD]USA[/TD]
[TD]34[/TD]
[TD]YES[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Emma[/TD]
[TD]USA[/TD]
[TD]54[/TD]
[TD]NO[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Tim[/TD]
[TD]UK[/TD]
[TD]67[/TD]
[TD]YES[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Sansa[/TD]
[TD]UK[/TD]
[TD]78[/TD]
[TD]NO[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Daenerys[/TD]
[TD]UK[/TD]
[TD]190[/TD]
[TD]YES[/TD]
[TD]6
[/TD]
[/TR]
</tbody>[/TABLE]