+ Reply to Thread
Results 1 to 4 of 4

Custom subject line with vb

  1. #1
    Forum Contributor
    Join Date
    05-27-2012
    Location
    New Brunswick, Canada
    MS-Off Ver
    Excel 2016
    Posts
    327

    Custom subject line with vb

    I have a document that has a worksheet for every day of the month. The names of each tab are numbered 1-31 (or 30 depending on the month). The name of the document ends in "2013-09"(where the 09 would change to 10 if the month were Oct, 11 for Nov, etc).

    CODE 1
    Please Login or Register  to view this content.
    I send each worksheet out the day after the day of the worksheet (so Sept 20 gets sent out on Sept 21). This works for everyday except the very last day because this code takes the name of the current month. So when I do Sept 31, which is sent on Oct 1, it's going to say Oct 31 in the subject line.

    CODE 2
    Please Login or Register  to view this content.
    This code will work as long as you send the document on the day you're supposed to. So if I send Sept 19th's info on Sept 20th no problem. But if I am not in the office and I need to send more than one day's info, it's going to put yesterday's date on both emails.

    Does anyone have any suggestion on how I can make my custom subject line work? Perhaps base it on the latter part of my document name? (which ends in 2013-09 for Sept).

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Custom subject line with vb

    Please Login or Register  to view this content.
    This will give you the Month abbreviation according to the month number in the filename which is alsways the last part of th ename before the extension separated by "-", e.g. 2009-08 will be "Aug"
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Custom subject line with vb

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    05-27-2012
    Location
    New Brunswick, Canada
    MS-Off Ver
    Excel 2016
    Posts
    327

    Re: Custom subject line with vb

    Much appreciated tehneXus! Works perfect!

+ 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. Replies: 0
    Last Post: 08-16-2011, 02:40 PM
  2. Tab Name in Email Subject Line
    By dagindi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-20-2010, 02:37 PM
  3. Auto email from excel with custom subject
    By Vikram in forum Excel General
    Replies: 12
    Last Post: 07-27-2006, 10:45 PM
  4. Customize Subject Line
    By terezakat in forum Excel General
    Replies: 0
    Last Post: 07-25-2005, 05:47 PM
  5. [SOLVED] Populate the subject line.
    By Scott Hutchinson in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-18-2005, 05:06 PM

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