I have a Google sheet with a cell (D1) that contains a formula (=TODAY()
) to show the current date. I am trying to create a macro that will simply copy the value of D1 as displayed (e.g., "5/18/2018") instead of the formula and then display that value as an actual date (i.e., "5/18/2018"). When I use Google sheets PASTE SPECIAL (Paste Value Only)
it actually displays the number "43238" instead of "5/18/2018". How do make it paste the actual date instead of the number?
-
Dates are stored as numbers. You need to format the cell to use the date format.– aleCommented May 18, 2018 at 17:46
2 Answers
You would use the text function.
If you have =today()
in A1, you would use =text(A1,"mm/dd/yyyy")
. (There are multiple formats for 'mm/dd/yyyy' if that's not the format you want.)
Alternatively you can pre-format the cell as a date, so pasting the value would automatically be displayed as a date.
Before use PASTE SPECIAL (Paste Value Only)
, try to use PASTE SPECIAL (Paste Format Only)
CTRL+Alt+V, the after use PASTE SPECIAL (Paste Value Only)
CTRL+Shift+V.
Worked fine here!