+ Reply to Thread
Results 1 to 6 of 6

VBA Macros to determine last month in a year

  1. #1
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    VBA Macros to determine last month in a year

    Hello Again,

    I am looking for help for a macros to calculate last month in a same year dynamic months & Years.

    Program need to check what his the last month in a year and take that amount for that last year and apply to the remaining months.

    Let say the year 2017 having last months is May and the amount is 30. So remaining months Jun, Jul Aug, Sep, Oct, Nov, Dec with applied 30 and count the total amount as 210 for remaining month.

    Copy of manual file is attached for your reference.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,619

    Re: VBA Macros to determine last month in a year

    Try such code:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VBA Macros to determine last month in a year

    Other method,

    Please Login or Register  to view this content.
    Kind regards
    Leo

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: VBA Macros to determine last month in a year

    And a third possible setup.

    Please Login or Register  to view this content.
    Alf

  5. #5
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Re: VBA Macros to determine last month in a year

    Thanks Kaper & LeoTaxi.

    Both of your script is working and LoeTaxi your script is more understandable.

    Thank for your support and help.

    Sorry Alf just of your script feedback your script is not working.

    Topic marked as solved.

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: VBA Macros to determine last month in a year

    Sorry Alf just of your script feedback your script is not working.
    Thanks for feedback I also found the formula for calculating the month did not like the month "May" changed it to the Swedish month "Maj" and the I had no problem. Was a bit puzzled as I run an English
    version of excel.

    Changing Region and Language setting in the windows setting "Format" tab from Swedish to English (United States) solved the "May" problem. Strange that the Windows setting has a higher hierarchy setting than the excel one. Oh well one live and learn.

    Alf

+ 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] SUM ARRAY to determine how many cells fall within a certain month and year (mixed data)
    By jparve3283 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2016, 12:12 PM
  2. Running Totals from 24 hours to month, month to year without year decreasing
    By Safetyintern in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-20-2015, 01:13 PM
  3. [SOLVED] formula to determine most recent month/year in range
    By Robert1311 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-29-2015, 09:08 AM
  4. [SOLVED] Determine work days in current month or next month based on day of the month
    By sbrnard in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-29-2014, 05:14 PM
  5. Replies: 3
    Last Post: 09-04-2013, 10:49 AM
  6. If Column A Month and Year = ColumnB Todays Month and Year then send email
    By HACCStaff in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-15-2013, 12:47 AM
  7. [SOLVED] PLOTTING BASED ON MONTH/YEAR [DATE] MACROS
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-06-2005, 11:05 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