hi,
cud i make excel accept date of particluar format only?ecither manually or thru VB code......
thanks and regards
vivek.s
Printable View
hi,
cud i make excel accept date of particluar format only?ecither manually or thru VB code......
thanks and regards
vivek.s
you format cells before you enter data into them, and it formats them as you enter the data. i don't think you can do anything other than check the data.
yes.......i was able to format the cells to accept date of a particular format but if enter some text(grabage values) still it accepts it......is there anyway to restrict the column to only accept dates?
thanks and regards
vivek.s
Quote:
Originally Posted by vivek.shankar
As dglienna said,
all you can do now is to validate the contents of the cell to see if it's a valid date from the garbage -
have the data entered into an unformatted cell. that way it will be easy to see what they were trying to do, rather than have excel change their input into what it thinks they wanted
Hey Vivek, you could use the selection and validate the cell contents there.
If its not a date then clear the cell and alert the user.
Code:Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If IsDate(ActiveCell) = False Then
MsgBox "Not a Date!", vbOKOnly
End If
End Sub
hi,
how can i alert if its not of particular format?for example if it is not of mm-dd-yyyy format.......
Thanks and Regards
S.vivek