Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Creating a macro for date range.

I have a perpetual calendar in excel that updates each month by simply
changing the month and year to reflect most current month and year. For each
month selected, formulas have been created to automatically insert 8hrs in a
cell during weekdays only, but not including weekends. The timeframe
captured is always the 1st-15th and sumed for total hrs and 16th-30th repeats
the same process. Under the required cell with the 8hrs, I put the actual
hrs worked for that day which is less than the required 8hrs or more. For the
timeframe ending on the 15th of every month, I'm using this formula
=IF((SUM(C$14-$B$3))<15,8,"") for the required 8hrs that automatically
populates the cell. The days are fomatted Sun-Sat. I said all this to ask
this question: 1) how do I create a formula that will add up my hrs
manually inserted, only from the 1st-15th, and not capture remaining hrs on
16th, 17th etc. if on the same row of 15th? Please keep in mind I have a
perpetual calendar 2) how do I create a macro button that will delete all
data from 1st-15th timeframe, no matter what month I change the calendar to?
3) how do I setup my perpetual calendar to post the name of US holidays per
month? The formula for the calendar days are =(WEEKDAY($B$3)=2)*B3+(B60)+B6
I don't know how to add the holiday to applicable day. Please help. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Creating a macro for date range.

I can only reply in principal as describing a workbook by references and
formula is not the easiest to decipher!

1. To add up specific days you could extract the day number using the DAY
function from each reference date, this will give you a numerical value to
use to control your summation. SUMIF(yourDAYSrange,
"<=15"),yourRangetoSum)

2. The macro you require could also use the above technique, looking for the
DAY value from 1 to 15, DAY will ignore month. But to supply code you need
to be more specific about what DATA you wish to delete and where it is
stored.

3. I have no idea what your formula is doing as it has cell references that
do not mean anything to me. In principal you could set up a lookup table
somewhere in your workbook (or in an external workbook) that contains ALL
holiday dates and names. Use the VLOOKUP function for each date in your
calendar to test if it is a holiday or not.

Regards


--

Regards,
Nigel




"Item Manager" wrote in message
...
I have a perpetual calendar in excel that updates each month by simply
changing the month and year to reflect most current month and year. For
each
month selected, formulas have been created to automatically insert 8hrs in
a
cell during weekdays only, but not including weekends. The timeframe
captured is always the 1st-15th and sumed for total hrs and 16th-30th
repeats
the same process. Under the required cell with the 8hrs, I put the actual
hrs worked for that day which is less than the required 8hrs or more. For
the
timeframe ending on the 15th of every month, I'm using this formula
=IF((SUM(C$14-$B$3))<15,8,"") for the required 8hrs that automatically
populates the cell. The days are fomatted Sun-Sat. I said all this to ask
this question: 1) how do I create a formula that will add up my hrs
manually inserted, only from the 1st-15th, and not capture remaining hrs
on
16th, 17th etc. if on the same row of 15th? Please keep in mind I have a
perpetual calendar 2) how do I create a macro button that will delete
all
data from 1st-15th timeframe, no matter what month I change the calendar
to?
3) how do I setup my perpetual calendar to post the name of US holidays
per
month? The formula for the calendar days are
=(WEEKDAY($B$3)=2)*B3+(B60)+B6
I don't know how to add the holiday to applicable day. Please help.
Thanks.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating columns based on date range childofthe1980s Excel Worksheet Functions 0 April 17th 08 06:25 PM
creating columns based on date range childofthe1980s Excel Programming 0 April 17th 08 06:04 PM
Creating date range for x-axis label in Excel '07 Bob Excel Discussion (Misc queries) 2 February 23rd 07 03:06 AM
Creating Date Range in Pivot Microsoft Query Ian Excel Discussion (Misc queries) 0 November 20th 05 10:10 PM
Problem Creating a Date Range coolroaming Excel Programming 2 April 17th 04 01:59 AM


All times are GMT +1. The time now is 10:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"