+ Reply to Thread
Results 1 to 2 of 2

Macro to send a mail on last day of every month if last day is sat or sunday send mail on

  1. #1
    Registered User
    Join Date
    03-05-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Macro to send a mail on last day of every month if last day is sat or sunday send mail on

    Hi Everyone,

    I am trying to write a macro to send mail on every Friday and also on last day of every month. If the last day of the month falls on Saturday or Sunday then the macro should mail on Friday. I have written a separate macro to send a mail. I have also written to check day(ie Monday, Tuesday etc) of today. If today is Friday or month end i can send mail. I dont know how to tell the macro to send mail on friday if the month last date is saturday or sunday. Is the below code is ok or i have add something ?. Please help me. I am now only starting to learn macro.

    Sub done()
    Dim Dat As Date, x As Integer, y As Date, sorry As String
    Dim str As String
    sorry = "Today is not friday or month end. So i cannot send mails"
    str = WeekdayName(Weekday(Now()))
    Dat = Date
    x = Month(Dat)
    y = Application.WorksheetFunction.EoMonth(Dat, x)
    If (str = friday) Or (Date = y) Then
    Send mail - Here i can include the mail part
    Else
    MsgBox sorry
    End Sub

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Macro to send a mail on last day of every month if last day is sat or sunday send mail

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Send to mail recipient, 1 worksheet, 2 cell ranges containing e-mail addresses
    By caladai in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-28-2013, 02:26 PM
  2. Automatic send email (without even click send in mail software) with excel vba ??
    By alexnkc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2013, 08:31 PM
  3. Send e-mail with image on body (.html) on e-mail manager <> outlook
    By mariotnc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2012, 09:28 PM
  4. Replies: 0
    Last Post: 07-22-2012, 01:34 PM
  5. How to e-mail selected row and use e-mail address in a cell to send e-mail from excel
    By syedalamgir in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-27-2010, 02:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1