I have a cell containing a date ex. "05/11/09" It is currently displayed as "11-MAY-09". How do I copy-paste or use VBA to get the string "11-MAY-09" into the cell next to it ( NOT "05/11/09")?
I can't figure it out other than piecing out the date pieces by itself.
There are two main reasons you might see a formula instead of a result: You accidentally enabled Show Formulas. Excel thinks your formula is text.
With a quick key combination you can see formulas instead of formula results in a worksheet. To show formulas in all cells press CTRL+` (that little mark is the grave accent mark key). When the formulas are visible, print your worksheet as you normally would.
Range("B1").Value = Range("A1").Text
Using the cell's .text instead of .value modifier will copy the text formatting instead of the raw date.
Chuck
I believe you can use the TEXT function to format a date value to your liking.
The format string of "dd-mmm-yy" would format "05/11/09" as "11-MAY-09".
Use the Format function.
Format("5/11/2009", "DD-MMM-YY")
This will return:
11-May-09
If case matters:
UCase(Format("5/11/2009", "DD-MMM-YY"))
returns:
11-MAY-09
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With