vba code for day

mrinal saha

Board Regular
Joined
Jan 20, 2009
Messages
229
Hi Folks,

need a simple code just to validate ,if today is 15th , 30th or 31st day of the month. pop up a msg on screen or on excel.
I wonder if there is any worksheetfunction for this.

Thanks,:)
Mrinal
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
If you want this in a cell then try

=IF(OR(DAY(TODAY())={15,30,31}), "Message", "")
 
Upvote 0
If vba (per your thread title) then is this what you want?

<font face=Courier New><br><br><SPAN style="color:#00007F">Sub</SPAN> CheckDay()<br>    <SPAN style="color:#00007F">Dim</SPAN> lDay <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN><br>    <br>    lDay = Day(Date)<br>    <SPAN style="color:#00007F">If</SPAN> lDay = 15 <SPAN style="color:#00007F">Or</SPAN> lDay = 30 <SPAN style="color:#00007F">Or</SPAN> lDay = 31 <SPAN style="color:#00007F">Then</SPAN><br>        MsgBox "This is one of your days (" & lDay & ")"<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0

Forum statistics

Threads
1,224,504
Messages
6,179,142
Members
452,892
Latest member
JUSTOUTOFMYREACH

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