Portucale
Member
Hi,
I have a procedure which tends to fix logins from a "date" to "text" but it seems that it looses the numeric part. Please note that the information is extracted from a database.
Example: login is Jan10, when I bring this to excel it formats as Jan-10, with the procedure below I am able to change it to 'Jan01', is there any way that the 10 would be kept?
Any help and all help is very much appreciated,
Kind regards,
I have a procedure which tends to fix logins from a "date" to "text" but it seems that it looses the numeric part. Please note that the information is extracted from a database.
Example: login is Jan10, when I bring this to excel it formats as Jan-10, with the procedure below I am able to change it to 'Jan01', is there any way that the 10 would be kept?
Code:
Public Sub FixIt()
If TypeName(Selection) = "Range" Then
With Selection
.NumberFormat = "@"
.Value = Evaluate("IF(ISNUMBER(" & .Address & "),TEXT(" & .Address & ",""mmmdd"")," & .Address & ")")
End With
End If
End Sub
Any help and all help is very much appreciated,
Kind regards,