• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

date format

vrunda

Member
my one sheet has data validation for date format. dd/mm/yy. But my data is with different date formats dd-mm-yyyy , dd-mm-yy, dd-mmm-yyyy----etc etc. I have a code :

Sub DateFormat()

If Selection Is Nothing Then

Exit Sub

End If

Selection.NumberFormat = "dd/mm/yy"

End Sub


it converts date in correct format but when i copy paste data in first sheet it does not accept. The sheet does not get validate also.
 
Vrunda

If the cells contain dates, it doesn't matter what format they are displayed in as a cell with a date using a display format of d will show that Day No and a format of dd mmm yy will show the day Month and Year but are still equal


It is more likely that some of the cells are text instead of Dates
 
Back
Top