Bralyan said:
thanks, that was easier than I thought, is there anything special that I
would need to do to paste the string back into a cell? like A2?
When one "enters" a value into a cell via VBA, e.g.:
Range("A2").Value = sStrValue
The value in sStrValue is evaluated the same way it would be if you
entered it manually. So if
sStrValue = "1/3"
will insert
1/3
into A2 using the above assignment, interpret it as a date and the cell
will display
03-Jan
or whatever the default date format is.
To assign the value so that it's interpreted as Text, you need to format
the cell first:
With Range("A2")
.NumberFormat = "@" 'Text
.Value = sStrValue
End With
Likewise, if you wish to use a specific date format, you have to change
the cell's .NumberFormat property, not just the string's format.