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

Add code to put the name of the sheet (i.e. the date) in a cell on the sheet
and use that in your formula. Or easier, have it put a label in that cell:
Weekday, Sun, Sat

then have your formula evaluate based on that value.

--
Regards,
Tom Ogilvy


"David" wrote:

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

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
hr worksheet counting days missed Tina Excel Worksheet Functions 2 May 5th 10 08:10 PM
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 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 11: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"