LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Formula using Days (DDD) in worksheet name

If I EVER get this finished!!
I have another request for my workbook to do. I have created a workbook that
creates workdays for the month and asks if the user wants to include
Saturdays and Sundays seperately. The workbook automatically excludes
holidays.
I have a total sales budget for the month, but now I need to put a different
sales goal in for Saturdays and Sundays, if they are used.
The approach I am using is formula based and I am weighting the different
days by the percentage the user can input on a setup page. For example, a
weekday is 100%, a Saturday can be 50% and a Sunday can be 33%. What I need
is to be able to COUNT the different days so I can get a total weight and
then apply the result to the daily sales goal (in the same cell on each
worksheet) for that particular day. The worksheets are named DDD-MMM-DD, so
would be MON-Sep-01, TUE-Sep-02, etc. I don't know how to have the formula
look at the DDD (Day) in the worksheet name and if Mon - Fri, apply the
weekday weight (just a range reference), Sat, the Sat weight and Sun, the Sun
weight.

This is the code that I am using to create the days of the month worksheets,
but I think this is a simply formula if I can look at the worksheet name for
the DDD part:

For iCtr = DateSerial(Year(myDate), Month(myDate), Day(myDate) + 1) To
DateSerial(Year(myDate), _
Month(myDate) + 1, 0)
'For iCtr = DateSerial(Year(myDate), Month(myDate), 1) To
DateSerial(Year(myDate), _
Month(myDate) + 1, 0) 'The 1 above starts with day one.
res = Application.Match(CLng(iCtr), Range("Holidays"), 0)
If IsError(res) Then
Select Case Weekday(iCtr)
Case Is = CaseSat '(Does all days, remove '& does only weekdays)
'do nothing
Case Is = CaseSun '(Does all days, remove ' & does only weekdays)
'do nothing
Case Else
Application.StatusBar = D
sh2.Copy after:=Sheets(Sheets.Count)
N = Sheets.Count - 5
ActiveSheet.Name = Format(iCtr, "ddd mm-dd")
Range("I4") = Format(iCtr, "mm-dd-yy")
Range("I10") = N + 1
ActiveSheet.Shapes("Button 1").Select
Selection.OnAction = "Mail_ActiveSheet"
Range("I3").Select
End Select
End If
Next
 
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
Need to pull <=14 Days, <=30 Days, 30 Days from a date column Ken Excel Discussion (Misc queries) 3 October 23rd 09 12:53 AM
FORMULA, DAYS WORKED TO VACATION DAYS John5835 Excel Worksheet Functions 2 July 31st 08 09:28 PM
Re Change 5 week days to 7 days in this formula pano Excel Worksheet Functions 7 February 1st 07 04:20 PM
Formula using Days (DDD) in worksheet name Tom Ogilvy Excel Programming 0 August 23rd 06 05:32 PM
formula for days in month - days left??? Jason[_18_] Excel Programming 3 August 23rd 03 09:58 PM


All times are GMT +1. The time now is 07:13 PM.

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

About Us

"It's about Microsoft Excel"