+ Reply to Thread
Results 1 to 6 of 6

Get Month

  1. #1
    Forum Contributor
    Join Date
    01-04-2011
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2003
    Posts
    129

    Get Month

    Hello All,

    I have a cell with a date in the format d/m/yyyy and I need to get the Month and put it in the format MMM. Part of the problem is that I don't know if the day number will be one or two digits, so I think I have to look between the / / marks.

    How can I do this. I appreciate any help. Thanks

    Kelly
    Last edited by jkelly228; 03-16-2011 at 11:46 AM. Reason: Solved

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Get Month

    Hello Kelly,

    In VBA you can simply use the Format statement.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    01-04-2011
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2003
    Posts
    129

    Re: Get Month

    Hello Leith,

    This is the code I used

    Please Login or Register  to view this content.
    and I get the error "Type Mismatch"

    Not sure if I am doing something wrong or not, but I want to apply this to the entire column "M" all the way to the last row.

    Thanks for the help.

    Kelly

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Get Month

    If you don't want to use code, then you can use the following formula and format it custom 'MMM'.

    =MONTH(DATEVALUE(A1)). Assumes formula is in cell B1 and your date is in A1.

    Just an alternative to Leith's method. Both are valid solutions.

    alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Get Month

    Hello Kelly,

    To apply the formatting to the entire column, use this statement...
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    01-04-2011
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2003
    Posts
    129

    Re: Get Month

    Thank you both. I appreciate the help. It worked.

+ 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