#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Dates

Ladies & Gents,

I was wondering if someone can help me with some date problems with an Excel
macro. I'm using a macro to send an email, and in that email I need 3
dates, the last working day of the month, the current month, and the first
working day of the new month. The email will be sent before the last
working day of the month. I can include the current month in the email, as
indicated below, but I am having problems with the other 2 dates. Can
someone please give me some help with working days in the month?

emlMthDate = Date - 27 ' To allow for February

Format(emlMthDate, "mmm-yyyy")


TIA

Andrew


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dates

this spreadsheet figures your days out - i'm sure it could be coded in
vba. John

Attachment filename: working days.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=614843
---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Dates

Try like:
Sub DateStuff()
Dim dBegMonth As Date
Dim dEndMonth As Date
Dim d1stMonday As Date

dBegMonth = Date - Day(Date)

dEndMonth = DateSerial(Year(Date), Month(Date) + 1, 0)

d1stMonday = dEndMonth - Weekday(dEndMonth, 2) + 8

MsgBox Format(dBegMonth, " dddd, d mmm yyyy") & vbNewLine & _
Format(dEndMonth, " dddd, d mmm yyyy") & vbNewLine & _
Format(d1stMonday, " dddd, d mmm yyyy")
End Sub


i've kept it simple.. to 1st monday.. ignoring holidays :(



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Andrew" wrote:

Ladies & Gents,

I was wondering if someone can help me with some date problems with an
Excel macro. I'm using a macro to send an email, and in that email I
need 3 dates, the last working day of the month, the current month,
and the first working day of the new month. The email will be sent
before the last working day of the month. I can include the current
month in the email, as indicated below, but I am having problems with
the other 2 dates. Can someone please give me some help with working
days in the month?

emlMthDate = Date - 27 ' To allow for February

Format(emlMthDate, "mmm-yyyy")


TIA

Andrew




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Dates

Duane,

Er.... um.... I can't seem to find any formulas on that sheet.... :-)

Andrew

Dates
From: duane
Date Posted: 7/11/2004 9:17:00 PM



this spreadsheet figures your days out - i'm sure it could be coded in
vba. John

Attachment filename: working days.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=614843
---
Message posted from http://www.ExcelForum.com/


Andrew wrote in message ...
Ladies & Gents,

I was wondering if someone can help me with some date problems with an Excel
macro. I'm using a macro to send an email, and in that email I need 3
dates, the last working day of the month, the current month, and the first
working day of the new month. The email will be sent before the last
working day of the month. I can include the current month in the email, as
indicated below, but I am having problems with the other 2 dates. Can
someone please give me some help with working days in the month?

emlMthDate = Date - 27 ' To allow for February

Format(emlMthDate, "mmm-yyyy")


TIA

Andrew



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
Linking computer dates (time) to spreadsheet dates that have formu bigisle Excel Worksheet Functions 3 January 3rd 10 08:05 PM
how do I sort a column of random dates into Consecutive dates Rob Gibson Excel Worksheet Functions 2 June 12th 07 05:10 AM
Identifying unique dates in a range of cells containing dates... cdavidson Excel Discussion (Misc queries) 4 October 13th 06 03:30 PM
Identifying unique dates within a range of cells containing dates cdavidson Excel Discussion (Misc queries) 0 October 12th 06 08:19 PM
need to convert list of dates to count no. of dates by week neowok Excel Worksheet Functions 13 January 30th 06 03:54 PM


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