Perhaps you could explain how the sample you posted isn't doing what you want because to me it seems to do exactly as you requested.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Ah, sorry - yes I see !
the above discounts check out date - the MAX should prove superfluous but you never know...=MAX(0,NETWORKDAYS.INTL(B2,C2-1,7))
the above discounts check out date - the MAX should prove superfluous but you never know...[/QUOTE]
Thanks that works well, i have another question though, is it possible to set check in and check out dates to Today() as default.
Last edited by DonkeyOte; 10-26-2010 at 02:13 AM. Reason: unnec. quote removed
Thanks that works well, i have to add another column that computes the number of weeks between 2 dates.Please See Demo.
Last edited by DonkeyOte; 10-26-2010 at 02:14 AM. Reason: unnec. quote removed
No need to quote prior posts in their entirety in your reply - this just clutters the board.
I confess that again I am a little confused by the example
is 21 nights so why is the expected results anything other than 3 weeks ?Check-In 7-Oct
Check-Out 28-Oct
Were
then I concur with 2 weeks, 4 weekday and 2 weekend:Check-Out 27-Oct
D2: =MAX(0,NETWORKDAYS.INTL(B2+(F2*7),C2-1,7)) E2: =C2-B2-(F2*7)-D2 F2: =MAX(0,INT(C2-B2/7))
Thanks i had already solved that one before you posted,now my last task is to have a message popup whenever the stay is exceeded by 3 weeks.I would really appreciate if you could help me out with this one:
If ((F2>3) OR ((F2 = 3) AND ((E2 >1) OR (D2>1)))) then
MsgBox (" Stay Cannot Exceed 3 Weeks !!! ")
End if
Except F2,E2,D2 are all columns with 54 rows, so when the user enters the check-in date and check-out date, D2 , E2 , F2 are computed and the macro should immediately alert the user if the above conditions are met.I'm really new to VBA, if you could code the macro for me that would be great.
Thanks
Last edited by bngguy; 10-26-2010 at 03:32 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks