+ Reply to Thread
Results 1 to 5 of 5

Want to change the dates in selected cells manually using a MACRO

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Want to change the dates in selected cells manually using a MACRO

    Dear Forum,

    I am working on a database which has been used and mis-used by several ex-employees each one adding his own date format which has a resulted in a big issue now...

    There are three dates and which have different formats like "mm/dd/yyyy" also "dd/mm/yyyy" and some other formats too..

    I tried changing the dates using formulas but in vain...since this date is a vital aspect of this databases tampering with it is too risky...

    So , i have to manually change each date after checking and confirming it with another inter portal..

    On most occassions the dates are mentioned as "dd/mm/yyyy" which need to be changed manually by changing the position of the first 2 characters to move in between and the 4,5th character of the dates to replace the 1,2 character and this has to be done over more than 5000 rows and 2 columns...

    The second column also has the same date except that the logic in this second column is that this is a date which three years - 1 day away from the first date.

    Ex: 1st date is mentioned incorrectly as - 07/06/2013 which is actually 6-Jun-13...and the second date will be 5-Jun-16.. ( Y+3, D - 1) where Y- Years & D is Days.

    Well the reason of doing manually is to avoid any errors in case of any other format than specified..

    So, I want someone to help me with a macro which can work on a selected range of data for two columns..

    The end format I want is make the dates read "6-Jun-13" which any layman can understand..

    Regards
    e4excel

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Want to change the dates in selected cells manually using a MACRO

    You say that some dates arew dd/mm/yy and others are mm/dd/yy. How do you know which is which for a date like you gave...07/06/2013?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Want to change the dates in selected cells manually using a MACRO

    Thats the reason i have to do it manually as there is one date which suggests that these dates can be greater than this particular date which is the Exam Date which is given in the format - d-mmm-yy so the other two dates are the certificate dates and certificate expiry date..the certificate date is always either 1 or more days after the Exam Date...as the Exam can be on a working day and then if there are Holidays falling after that then it would delay the certificate generation date...

    So this has to be done manually and so I am looking out for a Macro which can get this done slightly faster as well as with manual intervention....

    I want the Macro to work on a selected range of cells, so that i can select two colums with a matris size of 2Col X more than 1 Row...

    Regards
    e4excel

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Want to change the dates in selected cells manually using a MACRO

    i must visit your office someday it seems to use such a variety of spreadsheets with problems
    Last edited by martindwilson; 12-04-2013 at 02:20 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Want to change the dates in selected cells manually using a MACRO

    I wish I had a chance to undo the bad...but the only way I can do it now is by manually changing the dates...

    please find my sheet with the dates as explained ....I have scrapped the sensitive information...
    Attached Files Attached Files

+ 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. Want to change the dates in selected cells manually using a MACRO
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-07-2013, 03:22 AM
  2. [SOLVED] Change order of selected cells with macro
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-21-2013, 06:28 AM
  3. Code to change color and value in calendar cells based on selected dates
    By John74 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2010, 02:01 PM
  4. Move contents of manually selected cell
    By nebb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-22-2009, 11:20 PM
  5. macro to white out (to change a font in selected cells)
    By Abi in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-03-2005, 05:06 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