Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need to pull <=14 Days, <=30 Days, 30 Days from a date column | Excel Discussion (Misc queries) | |||
FORMULA, DAYS WORKED TO VACATION DAYS | Excel Worksheet Functions | |||
Re Change 5 week days to 7 days in this formula | Excel Worksheet Functions | |||
Formula using Days (DDD) in worksheet name | Excel Programming | |||
formula for days in month - days left??? | Excel Programming |