PDA

View Full Version : Solved: Save dates for weekly figures



Hoopsah
01-15-2009, 02:39 AM
Hi

I have attached a copy of a workbook that allows the user to input absence for a FTE.

Within the tab "Absence Worksheet" I have used NETWORKDAYS to work out how long an absence period lasts.

However, when it comes to reporting I have to tally up the figures per week.

Is there a way to save the data in weekly windows. i.e. if the absence period is from 05/01/09 - 19/01/09 instead of reporting 11 days it would report:
05/01/09 - 09/01/09 - 5 Days,
12/01/09 - 16/01/09 - 5 Days,
19/01/09 - 19/01/09 - 1 Day - Total 11 days

Hope that makes sense

Thanks for any pointers/help

Hoopsah

Bob Phillips
01-15-2009, 05:03 AM
Your monthly absence calculation fails if the absenc goes over a month end.

I would do it with VBA.

Hoopsah
01-15-2009, 05:35 AM
Hi Bob,

Fantastic!!

Once again, this works perfectly, thanks for your help.

Gerry

Hoopsah
01-15-2009, 06:58 AM
Hi Bob,

I know this is something I should probably know by now, but, when I copy the code over to my actual workbook and try to run it, I get an error message "424 - Object Required" and it stops at line: LastRow = .Cells(.Rows.Count, .Range("StartDates").Column).End(xlUp).Row

Bob Phillips
01-15-2009, 07:05 AM
Gerry,

I changed the codenames of the sheets in the sample workbbok. I changed Sheet1 to wsAbsence, it is probably the only relevant one.

Hoopsah
01-15-2009, 07:19 AM
So would I just change that to the sheet name ???

Sorry if I'm being dumb here

Bob Phillips
01-15-2009, 07:33 AM
No, in the VBIDE, change the codename from Sheet1 to wsAbsence.

Take a look in the book I posted by looking at the worksheet objects in the Project Explorer.

Hoopsah
01-15-2009, 08:34 AM
Ahh! Got You.

Cheers Bob, I have changed the name and it works fine now.

Thanks Again

Gerry