Results 1 to 3 of 3

Thread: Replace Incorrect Date In Cell To Another Valid Date

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    13
    Quote Originally Posted by DARSHANKmandya View Post
    I want replace the 1/1/9999 to normal date.

    Scenario:

    On E column : I have 18/03/13(like this dates)
    On L column : I have 1/1/9999(like this dates)

    Now I want to replace the cell value in L column which is in present in E column. First it has to search for this format 1/1/9999 in given column and has to replace all these cells by 18/03/13 dates.
    I have assumed you have several different dates in Column E and you want to move each one over to Column L only if the entry in Column L is 1/1/9999. If that assumption is correct, then I think this macro will do that for you...
    Code:
    Sub Replace9999Dates()
      Dim LR As Long
      LR = Cells(Rows.Count, "L").End(xlUp).Row
      Range("L1:L" & LR) = Evaluate("IF(L1:L" & LR & "=0+""1/1/9999"",E1:E" & LR & _
                                    ",IF(LEN(L1:L" & LR & "),L1:L" & LR & ",""""))")
    End Sub
    Last edited by Rick Rothstein; 03-21-2013 at 09:30 PM.

Similar Threads

  1. Replies: 5
    Last Post: 06-15-2013, 12:40 PM
  2. date format
    By Safal Shrestha in forum Excel Help
    Replies: 1
    Last Post: 01-02-2013, 02:53 PM
  3. Default Cell Format Changed to Date
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 05-07-2012, 10:14 PM
  4. Spell a Date out in Words
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 6
    Last Post: 04-08-2012, 12:19 PM
  5. Spell a Date out in Words
    By Rick Rothstein in forum Excel and VBA Tips and Tricks
    Replies: 4
    Last Post: 02-25-2012, 08:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •