H
HammerJoe
Hi,
Here is an interesting problem.
I have an archive sheet that is used to store info at the beggining of
every week.
Right now each week and at beggining of every month the weekly results
and/or monthly are added to the first empty row in the sheet.
Column A identifies the date range.
For weekly results it shows "21Jul-26Jul" by using this code
..Range("A" & LastRow).Value =
Format(Sheets("Settings").Range("E24").Value, "ddmmm") + "-" +
Format(Sheets("Settings").Range("E25").Value, "ddmmm")
where E24 has the date of the beggining of the week (2008/07/21) and
E25 the end of the week (2008/07/26)
For the Monthly results it shows "JUL-08" (month and year) using this
code :
..Range("A" & LastRow).Value =
Format(Sheets("Settings").Range("E24").Value, "mmm-yyyy")
Pretty straightforward and simple.
Now I want to complicate things and add daily results to this sheet as
well.
This daily number would also only be added at the end of week.
Column A would have full date (2008-JUL-21).
Thats the easy part.
Where it gets complicated is that I want to remove all the daily
results rows if the date is older than a user defined number of weeks
but keep the Weekly and Monthly results.
For example if its defined that results older than four weeks should
be deleted, then the macro would have to find anything older than
Jun-25 and remove the daily rsult rows that are older than four weeks.
My two problems with this:
- Does Excel have a quick and easy way to find the row that matches
the date instead of using a loop to go thru all the rows from the
bottom up until it finds the date?
- How to delete the rows that are daily results and leave the weekly
and monthly ones because I want to keep those?
Thanks.
Here is an interesting problem.
I have an archive sheet that is used to store info at the beggining of
every week.
Right now each week and at beggining of every month the weekly results
and/or monthly are added to the first empty row in the sheet.
Column A identifies the date range.
For weekly results it shows "21Jul-26Jul" by using this code
..Range("A" & LastRow).Value =
Format(Sheets("Settings").Range("E24").Value, "ddmmm") + "-" +
Format(Sheets("Settings").Range("E25").Value, "ddmmm")
where E24 has the date of the beggining of the week (2008/07/21) and
E25 the end of the week (2008/07/26)
For the Monthly results it shows "JUL-08" (month and year) using this
code :
..Range("A" & LastRow).Value =
Format(Sheets("Settings").Range("E24").Value, "mmm-yyyy")
Pretty straightforward and simple.
Now I want to complicate things and add daily results to this sheet as
well.
This daily number would also only be added at the end of week.
Column A would have full date (2008-JUL-21).
Thats the easy part.
Where it gets complicated is that I want to remove all the daily
results rows if the date is older than a user defined number of weeks
but keep the Weekly and Monthly results.
For example if its defined that results older than four weeks should
be deleted, then the macro would have to find anything older than
Jun-25 and remove the daily rsult rows that are older than four weeks.
My two problems with this:
- Does Excel have a quick and easy way to find the row that matches
the date instead of using a loop to go thru all the rows from the
bottom up until it finds the date?
- How to delete the rows that are daily results and leave the weekly
and monthly ones because I want to keep those?
Thanks.