Help with macro for copying values that change weekly and paste them in another sheet (for keeping a record of every week)

sgeslava

New Member
Joined
Jun 15, 2011
Messages
3
Hello,
I am having some trouble coming up with a code that does the following:
There is one sheet in wich people type some numbers every day, once the week is over, they delete the numbers from the previous week, change the dates and start recording the numbers for the next week.
What I need to do is to store the values from each week in a different tab, so we keep record of all the weeks.

I tryed to do that using the IF function, copying the values from the original sheet and pasting them into another sheet under the week that corresponds.
but I would have to do that with all the weeks, which makes it long and I beleive we can only use 7 IF functions together, and I need all the weeks in a year.

here is an example of the code I had:

If #6/18/2011# >= Date And #6/12/2011# < Date Then
Sheets("BAY-01").Select
Range("AK5:AK29").Select
Selection.Copy
Sheets("WeeklySummary").Select
Range("D7").Select
Selection.PasteSpecial (xlPasteValues)
End If
If #7/2/2011# >= Date And #6/19/2011# < Date Then
Sheets("BAY-01").Select
Range("AK5:AK29").Select
Selection.Copy
Sheets("WeeklySummary").Select
Range("G7").Select
Selection.PasteSpecial (xlPasteValues)
End If

I would really appreciate any comments or suggestions,
Thank you in advance!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,224,514
Messages
6,179,220
Members
452,895
Latest member
BILLING GUY

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