+ Reply to Thread
Results 1 to 4 of 4

VB - Writes current month and previous months in cells

  1. #1
    Forum Contributor
    Join Date
    08-06-2007
    Posts
    105

    VB - Writes current month and previous months in cells

    Hello,

    Can someone please type me up a quick VB formula that - when ran - will put the current month in cell "S3" and then put the previous 5 months in cells U3, W3, Y3, AA3, and AC3?

    IE - "July" in S3, then "June" in U3, then "May" in W3, etc.

    Also, the current month should be "Yellow" in background color, the rest of the months are gray 15.

    Thank you so much!

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: VB - Writes current month and previous months in cells

    Try

    =TEXT(TODAY(),"mmmm")

    =TEXT(DATE(YEAR(TODAY()),MONTH(TODAY())-1,1), "mmmm")

    etc.

  3. #3
    Forum Contributor
    Join Date
    08-06-2007
    Posts
    105

    Re: VB - Writes current month and previous months in cells

    Thanks, but I need this for Visual Basic - not a regular excel formula

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VB - Writes current month and previous months in cells

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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