Change Date to plain text

nt82

Board Regular
Joined
Jan 29, 2009
Messages
133
Hi..I have a cell in excel which has date '20180907' and when i click the cell it shows 9/7/2018.

I would like to convert this cell to plain text and remove the date so it stays as '20180907' and not the date.

thanks in advance.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Then it sounds like what you currently have is a valid date with a Custom Format of something like "YYYYMMDD" or "YYYYDDMM"
(I cannot tell from your example whether Month or Day comes first - it depends on whether you are using an American or European version of Excel, so adjust the formulas below accordingly).

A formula to return the value of A1 to text would look like:
Code:
=TEXT(A1,"YYYYMMDD")

In VBA, it would look something like:
Code:
FORMAT(RANGE("A1"),"YYYYMMDD")
 
Upvote 0

Forum statistics

Threads
1,215,474
Messages
6,125,024
Members
449,204
Latest member
LKN2GO

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top