Macros - Copy data from one worksheet to another with date constraint

audiman09

New Member
Joined
Jul 26, 2012
Messages
3
Hi everyone, I am fairly new to excel and need help with excel programming / macros.
I am project manager and trying to develop project financial tracking sheet.

I have created a sheet to track "Project Forecast effort" and "Project Actual effort". At the start of the project I create project forecast (in $ & effort in days) based on my scope and then every week I update my actuals in "Project Actual effort" and then manually adjust "Project forecast sheet". This takes very long time and get challenging for a project with large number of resources.
I was wondering if any one can help me automate this process.

Attached below is a snap short from my Actuals and Forecast sheet

Labour Actuals:

[TABLE="width: 616"]
<colgroup><col style="width: 77pt; mso-width-source: userset; mso-width-alt: 3766;" span="8" width="103"> <tbody>[TR]
[TD="class: xl74, width: 412, bgcolor: #D9D9D9, colspan: 4"]Week Ending Sunday Enter Effort in Days (1 day = 8 hrs)[/TD]
[TD="class: xl74, width: 412, bgcolor: #D9D9D9, colspan: 4"]Week Ending Sunday Enter Effort in Days (1 day = 8 hrs)[/TD]
[/TR]
[TR]
[TD="class: xl73, width: 103, bgcolor: #D9D9D9"]04-Jul-12[/TD]
[TD="class: xl70, width: 103, bgcolor: #D9D9D9"]11-Jul-12[/TD]
[TD="class: xl70, width: 103, bgcolor: #D9D9D9"]18-Jul-12[/TD]
[TD="class: xl70, width: 103, bgcolor: #D9D9D9"]25-Jul-12[/TD]
[TD="class: xl70, width: 103, bgcolor: #D9D9D9"]01-Aug-12[/TD]
[TD="class: xl70, width: 103, bgcolor: #D9D9D9"]08-Aug-12[/TD]
[TD="class: xl70, width: 103, bgcolor: #D9D9D9"]15-Aug-12[/TD]
[TD="class: xl70, width: 103, bgcolor: #D9D9D9"]22-Aug-12[/TD]
[/TR]
[TR]
[TD="class: xl72, width: 103, bgcolor: #C5D9F1"]4.0[/TD]
[TD="class: xl72, width: 103, bgcolor: #C5D9F1"]4.0[/TD]
[TD="class: xl72, width: 103, bgcolor: #C5D9F1"]6.0[/TD]
[TD="class: xl72, width: 103, bgcolor: #C5D9F1"]7.0[/TD]
[TD="class: xl72, width: 103, bgcolor: #C5D9F1"]5.0[/TD]
[TD="class: xl72, width: 103, bgcolor: #C5D9F1"][/TD]
[TD="class: xl72, width: 103, bgcolor: #C5D9F1"][/TD]
[TD="class: xl72, width: 103, bgcolor: #C5D9F1"][/TD]
[/TR]
</tbody>[/TABLE]


Forecast Data:
[TABLE="width: 616"]
<colgroup><col style="width: 77pt; mso-width-source: userset; mso-width-alt: 3766;" span="8" width="103"> <tbody>[TR]
[TD="class: xl71, width: 412, bgcolor: #D9D9D9, colspan: 4"]Week Ending Sunday Enter Effort in Days (1 day = 8 hrs)[/TD]
[TD="class: xl71, width: 412, bgcolor: #D9D9D9, colspan: 4"]Week Ending Sunday Enter Effort in Days (1 day = 8 hrs)[/TD]
[/TR]
[TR]
[TD="class: xl69, width: 103, bgcolor: #D9D9D9"]04-Jul-12[/TD]
[TD="class: xl69, width: 103, bgcolor: #D9D9D9"]11-Jul-12[/TD]
[TD="class: xl69, width: 103, bgcolor: #D9D9D9"]18-Jul-12[/TD]
[TD="class: xl69, width: 103, bgcolor: #D9D9D9"]25-Jul-12[/TD]
[TD="class: xl69, width: 103, bgcolor: #D9D9D9"]01-Aug-12[/TD]
[TD="class: xl69, width: 103, bgcolor: #D9D9D9"]08-Aug-12[/TD]
[TD="class: xl69, width: 103, bgcolor: #D9D9D9"]15-Aug-12[/TD]
[TD="class: xl69, width: 103, bgcolor: #D9D9D9"]22-Aug-12[/TD]
[/TR]
[TR]
[TD="class: xl74, width: 103, bgcolor: #C5D9F1"]2.0[/TD]
[TD="class: xl74, width: 103, bgcolor: #C5D9F1"]3.0[/TD]
[TD="class: xl74, width: 103, bgcolor: #C5D9F1"]5.0[/TD]
[TD="class: xl74, width: 103, bgcolor: #C5D9F1"]6.0[/TD]
[TD="class: xl74, width: 103, bgcolor: #C5D9F1"]7.0[/TD]
[TD="class: xl74, width: 103, bgcolor: #C5D9F1"]8.0[/TD]
[TD="class: xl74, width: 103, bgcolor: #C5D9F1"]4.0[/TD]
[TD="class: xl74, width: 103, bgcolor: #C5D9F1"]6.0[/TD]
[/TR]
</tbody>[/TABLE]


What I would like to do is to copy data from first one upto 01-Aug-12 into second sheet but not overwrite data in forecast sheet beyond that 01-Aug (current date).

would greatly appreciate help.

Regards
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Does this help?

Code:
Sub audiman09()

Range("A3").Select

Do While ActiveCell.Value <> ""

    ActiveCell.Offset(, 1).Select
    
Loop

Range(Range("A3"), ActiveCell.Offset(, -1)).Copy Sheets("Forecast").Range("A3")

End Sub
 
Last edited:
Upvote 0
Thanks for your help John.
It didn't really work but then probably I am doing it wrong. I copy and paste these instructions in a Marco (using record marco option) and then tried it. nothing happend.
I am very new to macros and so probably doing it wrong. Also I want todo this for all 15 resources in my actual sheet. will it work?


Does this help?

Code:
Sub audiman09()

Range("A3").Select

Do While ActiveCell.Value <> ""

    ActiveCell.Offset(, 1).Select
    
Loop

Range(Range("A3"), ActiveCell.Offset(, -1)).Copy Sheets("Forecast").Range("A3")

End Sub
 
Last edited:
Upvote 0
Thanks for helping me with this one John.
The sheet names are "Labour Actuals" and Labour Forecast".

I did try to run it from "Labour Actuals" sheet.
I selected View-Macross-Record Macros
Macro Name= Copy_Actuals
and in Description copy and paste your instructions.
Then Stop Recording
View Macros & finally RUN... nothing happens.

BTW I tried renaming the sheets as "Actuals" and "forecast" but still no result.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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