Copy and Paste range of cells to different tabs according to multiple criteria using VBA

MineEng

New Member
Joined
Aug 25, 2014
Messages
1
Hi All,

This is my first post and I'm relatively new to VBA so bear with me here. I'm trying to establish some code to copy data from one tab and paste it to other tabs according to multiple criteria. Here's some more background info:

Data Input:
Cell "A2" contains the Data Date
Cell "C1" contains the Project Name
Cells "B8:B69" contain Equipment Type
Cells "C8:C69" contain Adjusted Equipment Hours
Cells "E8:E69" contain Actual Equipment Hours

This information is then repeated in the adjacent columns with the exception of the referenced Data Date and Equipment Type; these cells remain the same.

The goal is to copy the Adjusted Equipment Hours and Actual Equipment Hours from the Data Input sheet and paste them to the matching equipment type and date found in another sheet of the workbook. The data must be copied to the worksheet/tab matching the project name listed in the Data Input sheet. Additionally, the data will be pasted to the columns on a regular basis matching the listed date in order to develop a historical database. I've copied some of the cells below to see how it looks. I'll try to attach the worksheet. Anything helps.

Cheers:)


"Data Input" Tab:


[TABLE="width: 917"]
<tbody>[TR]
[TD]Week ending[/TD]
[TD]Project Name[/TD]
[TD="colspan: 3"]Project 1[/TD]
[TD="colspan: 3"]Project 2[/TD]
[/TR]
[TR]
[TD]01-Jan[/TD]
[TD]SPO[/TD]
[TD="colspan: 3"][/TD]
[TD="colspan: 3"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Paid Hours per 24hr period[/TD]
[TD="colspan: 3"]12[/TD]
[TD="colspan: 3"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Days Off[/TD]
[TD="colspan: 3"]0[/TD]
[TD="colspan: 3"][/TD]
[/TR]
[TR]
[TD]Sequencing Period[/TD]
[TD]Weather Delays (days)[/TD]
[TD="colspan: 3"]0[/TD]
[TD="colspan: 3"][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Availability[/TD]
[TD="colspan: 3"]80%[/TD]
[TD="colspan: 3"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Plan vs. Actual[/TD]
[TD]Forecasted Units[/TD]
[TD]Adjusted Equipment Hours[/TD]
[TD]Actual Equipment Hours[/TD]
[TD]Forecasted Units[/TD]
[TD]Adjusted Equipment Hours[/TD]
[TD]Actual Equipment Hours[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Unit 1[/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Unit 2[/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Unit 3[/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 584"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

"Project 1" Tab

[TABLE="width: 707"]
<tbody>[TR]
[TD]Week Ending[/TD]
[TD="colspan: 3"]1-Jan-14[/TD]
[TD="colspan: 3"]8-Jan-14[/TD]
[/TR]
[TR]
[TD]Plan vs. Actual[/TD]
[TD]Adjusted Equipment Hours[/TD]
[TD]Actual Equipment Hours[/TD]
[TD]Variance[/TD]
[TD]Adjusted Equipment Hours[/TD]
[TD]Actual Equipment Hours[/TD]
[TD]Variance[/TD]
[/TR]
[TR]
[TD]Unit 1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Unit 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Unit 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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