+ Reply to Thread
Results 1 to 11 of 11

Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

  1. #1
    Registered User
    Join Date
    06-10-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    12

    Smile Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

    Hi everyone I'm new here and need help in developing a macro to change the dates of various fields in one column.

    I need to change the date format of Jun 5, 2011 to 05/06/2011

    I have tried the inbuilt functions of highlighting the required cells and clicking 'Format Cells-->Category:Date--->Type3rd selection)' however this wont work.

    I may also have other date formats within this column so I guess I might have to create an IF statement saying IF date = Jun 5, 2011 then 05/06/2011 else 05/06/2011.

    Can anyone help me with this conundrum please?

    Regards


    Red
    Last edited by romperstomper; 06-14-2011 at 08:50 AM. Reason: mark solved

  2. #2
    Registered User
    Join Date
    06-10-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

    Ok we got half way there in formula world using:

    =CONCATENATE(MID($R12,5,SEARCH(",",$R12)-5), " ",SUBSTITUTE($R12,CONCATENATE(MID($R12,5,SEARCH(",",$R12)-5 ),","),""))

    Which gave us this result:5 Jun 2011

    (Imagine R12 is Jun 5, 2011)


    Almost there but it added an extra space...

    eg. 5*Jun**2011

    What I want to do is get rid of this space then convert this into a macro
    Last edited by Red2Black; 06-10-2011 at 11:59 AM. Reason: additional notes required

  3. #3
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

    Is Jun 5, 2011 a real date ( custom formatted) or text looking like date? To check this out enter =isnumber(date_cell) somewhere.
    Does it answer true or false ?

  4. #4
    Registered User
    Join Date
    06-10-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

    False I believe squire - but this is how the data has been inputted manually. I just need to correct 1000's of rows and I'll be damned if I'm going through one by one!!!! The dates need to be read by a web app and need to be in format: 05/06/2011

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  6. #6
    Registered User
    Join Date
    06-10-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

    Ok as requested - attached is a spreadsheet with clear specifications as to what I'm trying to achieve - the formula posted above is present to illustrate what I need the Macro to do

    Hope this clarifies things better and that someone can lend a helping hand


    Thanks guys


    Red

    Date Standardisation macro Requirements.xls
    Last edited by Red2Black; 06-13-2011 at 05:53 AM. Reason: Attached in wrong place

  7. #7
    Registered User
    Join Date
    06-10-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

    @arthurbr Did you find the attachement ok?

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

    Select the dates. Then choose Data-Text to columns, specify delimited in step 1, accept defaults for step 2, then in step 3 specify Date and MDY format, then click Finish.
    Remember what the dormouse said
    Feed your head

  9. #9
    Registered User
    Join Date
    06-10-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

    Interesting - almost had it there! It changed Apr 26, 2011
    to
    Apr-26 with a wrap of (01/04/2026)


    Tried MDY, DYM, YMD, DMY, YDM - hmmmmm no luck - same result


    April 26, 2011 turns to 01/04/2026

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

    Curious. Oh, did you have Comma checked as a delimiter in step 2 of the wizard? If so, uncheck it.

  11. #11
    Registered User
    Join Date
    06-10-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Help with Date Macros - eg. Change Values From Jun 5, 2011 to 05/06/2011

    Genious! You did it!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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