+ Reply to Thread
Results 1 to 9 of 9

Extract Year, Month, Day from date

  1. #1
    Registered User
    Join Date
    03-13-2016
    Location
    Yemen
    MS-Off Ver
    2016
    Posts
    59

    Extract Year, Month, Day from date

    Hello All

    I have below attachment
    when I enter a text in cell H automatically the today date appears (by vba code) on Cell E Full Day format
    Cell D Year Format
    Cell C Month Format
    Cell B Day Format

    but when I put the mouse curser on D,C & B format i see full day on formula bar

    Is there a solution to see only year on formula bar for cell D
    &
    to see only month on formula bar for cell C
    &
    to see only day on formula bar for cell D

    The below code is change the date format but what I need exactly is to extract part of the date either year, month or day

    Please Login or Register  to view this content.
    Thank you

    123.JPG
    Attached Files Attached Files

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Extract Year, Month, Day from date

    Hello stoicy,

    As long as the Cell displays the data you want to see, why should it bother you what shows in the Formula Bar?

    The Formula Bar always display the true calculation or essence of a Cell's value, whilst the Cell Formats shows you what you would prefer to see in the Cell itself.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    03-13-2016
    Location
    Yemen
    MS-Off Ver
    2016
    Posts
    59

    Re: Extract Year, Month, Day from date

    because I am plan to make a formula calculating how many months repeated and register and how many year repeated and register

    this is the reason

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Extract Year, Month, Day from date

    Hi stoicy,

    Have you tried that using the Cell Values?

    Regards.

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Extract Year, Month, Day from date

    As a first answer see here
    Clearly to be improve: On going
    Please Login or Register  to view this content.
    Last edited by PCI; 03-28-2016 at 02:01 PM.
    - Battle without fear gives no glory - Just try

  6. #6
    Registered User
    Join Date
    03-13-2016
    Location
    Yemen
    MS-Off Ver
    2016
    Posts
    59

    Re: Extract Year, Month, Day from date

    Woooooooow

    Than you PCI

    that is what I want ...cool

    Thank you so much

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Extract Year, Month, Day from date

    Another way, without to fire several times the change macro
    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Extract Year, Month, Day from date

    Another way more flexible for the date format: It just follows Excel language
    From your macro
    Please Login or Register  to view this content.
    and the remake updated
    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: Extract Year, Month, Day from date

    Try
    Please Login or Register  to view this content.
    Note:
    If MonthName(Month(Date), True) doesn't appear properly, change it to Format$(Date, "mmm")
    i.e
    Please Login or Register  to view this content.
    Last edited by jindon; 03-28-2016 at 11:53 PM.

+ 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] Extract 2 corresponding fields by Date/Month/Year selection
    By suchetherrah in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-01-2015, 08:31 AM
  2. [SOLVED] Extract Day, Month and Year from a text box (user input) date value
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-01-2014, 10:40 PM
  3. [SOLVED] Formual to Extract month and year from sheet name
    By rizmomin in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 07-26-2014, 10:49 PM
  4. Need to convert Month/Date/Year to Year/Month/Date so excel will recognize
    By juliettelam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2014, 04:17 PM
  5. Replies: 3
    Last Post: 09-04-2013, 10:49 AM
  6. [SOLVED] Extract Year or Month only from a cell with date and time
    By djaurit in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2013, 04:03 PM
  7. [SOLVED] Extract Text from String then Convert to a Date (Month/Year)
    By sgrey24 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-14-2013, 06:11 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