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: 9
Default Can some one modify the thirdfriday code to get me the following d

I want these following dates
Friday, March 19, 2010
Friday, June 18, 2010
Friday, September 17, 2010
Friday, December 17, 2010
Friday, March 18, 2011
Friday, June 17, 2011
Friday, September 16, 2011
Friday, December 16, 2011
Friday, March 16, 2012
Friday, June 15, 2012
Friday, September 21, 2012
Friday, December 21, 2012
Friday, March 15, 2013
Friday, June 21, 2013
to be converted to next mondays like as given
below.
Monday, March 15, 2010
Monday, June 14, 2010
Monday, September 13, 2010
Monday, December 13, 2010
Monday, March 14, 2011
Monday, June 13, 2011
Monday, September 19, 2011
Monday, December 19, 2011
Monday, March 19, 2012
Monday, June 18, 2012
Monday, September 17, 2012
Monday, December 17, 2012
Monday, March 18, 2013
Monday, June 17, 2013
by changing the following VBA code which generates
the Fridays.

Function vbaThirdFriday(ByVal aDate As Date) As Date
On Error GoTo ErrorLabel
Dim Roll As Date, roll2 As Double
Roll = DateSerial(Year(aDate), Month(aDate), 15)
Debug.Print Roll
vbaThirdFriday = Roll + (13 - Weekday(Roll)) Mod 7
roll2 = (13 - Weekday(Roll)) Mod 7
Debug.Print vbaThirdFriday, roll2
Exit Function
ErrorLabel:
MsgBox "error in vbaThirdFriday( " + Str(aDate) + " )"
vbaThirdFriday = aDate
End Function
Thank YOU all Expert Sirs. Please help.
 
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
How can I modify my code to offset the defined range and repeat theprocedure instead of duplicating my code? [email protected] Excel Programming 4 May 29th 09 10:13 PM
Need help to modify RDB code winnie123 Excel Programming 6 April 18th 09 09:19 AM
Modify Code Richard Excel Worksheet Functions 0 March 13th 08 08:19 PM
Modify existing code to dynamic code Ixtreme Excel Programming 5 August 31st 07 11:42 AM
Modify code in UDF Biff Excel Programming 9 August 31st 05 04:41 AM


All times are GMT +1. The time now is 03:00 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"