Dates by day of week of the month

keen1598

New Member
Joined
Apr 2, 2013
Messages
16
So I'm trying to figure out the code to simply display the number of the day for the Second Tuesday of the month, but have been unsuccessful thus far in my forum search.

I know this is possible in outlook, but creating a self generating email in outlook is a PAIN so I'm using excel to generate and email, based on a macro that is called when a specific file is opened. The email body of the email needs to contain a date specific to the current month, the second tuesday of that month, and the current year. so far I have the month, and year part down but the day is giving me issues.

"is to be conducted Tuesday, " & MonthName(Month(Date)) & **the second tuesday of the current month** & ", " & Year(Now) & vbCrLf & _

any ideas?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
The second tuesday of the month should be: =14-WEEKDAY(DATE(Month(Date),Year(Date),1),14)
 
Upvote 0
Your function doesnt seem to want to work for me... Mind you VBA not WS. idk if you used ws code..

I'm getting a ")" expected error and it highlights "Month"
 
Last edited:
Upvote 0
Ya, that was a cell formula. If you change the "date" part in both month and year to an actual date, it works fine for me... please re-try.

If you want a vba solution it is the same idea...

iDay = 14- weekday(dt, vbThursday) 'use vbThursday so you get a 7 on Tuesday and work from there

Code:
Sub test()
Dim iDt As Integer
Dim d As Date
d = Now() - Day(Now) + 1 'This gives you the first of the month
iDt = 14 - Weekday(d, vbThursday) 'd should be the first of any month
MsgBox (iDt)
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top