+ Reply to Thread
Results 1 to 5 of 5

VBA Program that returns the first monday of a month

  1. #1
    Registered User
    Join Date
    08-30-2016
    Location
    Harare, Zimbabwe
    MS-Off Ver
    2010
    Posts
    5

    VBA Program that returns the first monday of a month

    Dear Friends

    I am trying to write a VBA code that allows me to enter a month and year in cells A2 and B2 respectively. After that it displays in C2 the date of the first Monday of that month in the inputted year. As an example, say I write October in A2 and 2016 in B2, it should return in C2: 3/10/2016. May someone help me please.

    Thank you code pros!

    Taoyuan00

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: VBA Program that returns the first monday of a month

    Assuming you have the month in A1 and the year in B1 you can use formula like this in C1
    Please Login or Register  to view this content.
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Registered User
    Join Date
    08-30-2016
    Location
    Harare, Zimbabwe
    MS-Off Ver
    2010
    Posts
    5

    Re: VBA Program that returns the first monday of a month

    Thanks a span Buran. It is certainly a good one. This only works when you use the month number though. If the month is in words it won't work. I am wondering if I can formulate code that uses If statements in VBA so that even if the month is spelt in words it will still give me the first Monday.

  4. #4
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: VBA Program that returns the first monday of a month

    that wasn't mentioned in your question
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-30-2016
    Location
    Harare, Zimbabwe
    MS-Off Ver
    2010
    Posts
    5

    Re: VBA Program that returns the first monday of a month

    Thank you very much Buran. You are great!!!

+ 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. [SOLVED] Date Formula which returns 3rd Monday On January
    By zanshin777 in forum Excel Formulas & Functions
    Replies: 29
    Last Post: 01-05-2016, 12:35 PM
  2. [SOLVED] First day of month falls on a Monday VBA issue
    By af25 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-10-2014, 07:24 PM
  3. Find every Monday in a month using VBA
    By EmmaO91 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2014, 07:32 AM
  4. [SOLVED] Sum from the last Monday of the month previous
    By Berna11 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-17-2013, 03:26 PM
  5. Teasing Monthly Returns from intra month returns
    By spcw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-14-2013, 05:14 PM
  6. Formula to recognise first monday of the month
    By Jonsocks in forum Excel General
    Replies: 8
    Last Post: 09-30-2010, 08:59 AM
  7. Replies: 1
    Last Post: 04-13-2005, 06:35 PM

Tags for this Thread

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