wrightyrx7
Well-known Member
- Joined
- Sep 15, 2011
- Messages
- 994
Hi all,
I have a problem and I cant get my head round how to fix it.
Basically i have 2 columns with dates in, and i need the dates to be formatted correctly otherwise is messes up some of my formula's. So if the date contains "." or "-" i replace them with "/"
So this works when a user is typing into the individual cells.
However, if the user pastes a whole row into the table the code does not run.
How do i get around this?
Thanks
I have a problem and I cant get my head round how to fix it.
Basically i have 2 columns with dates in, and i need the dates to be formatted correctly otherwise is messes up some of my formula's. So if the date contains "." or "-" i replace them with "/"
Code:
If Target.Column = 1 Or Target.Column = 12 Then If InStr(1, Target.Value, ".") > 0 Or InStr(1, Target.Value, "-") > 0 Then
Application.EnableEvents = False
Target.Value = Replace(Target.Value, ".", "/")
Target.Value = Replace(Target.Value, "-", "/")
Application.EnableEvents = True
End If
End If
So this works when a user is typing into the individual cells.
However, if the user pastes a whole row into the table the code does not run.
How do i get around this?
Thanks