ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find and Replace - Auto Cell Formats (https://www.excelbanter.com/excel-programming/281191-find-replace-auto-cell-formats.html)

bslater[_11_]

Find and Replace - Auto Cell Formats
 
I have a column of date data that is in text format by design. I want
to do a find and replace for this column to change "/2003" to "/03",
"/2004" to "/04", etc. I have coded this into my macro, but Excel
automatically sets the cell format to a date type when the find and
replace occurs. Is there any way to stop this from happening? Can I
lock the format of these cells?

Thanks!



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


John Green[_3_]

Find and Replace - Auto Cell Formats
 
If you place a single quote in front of each cell entry ('), it will be treated as text and the replace will leave the entry as
text.

--

John Green - Excel MVP
Sydney
Australia


"bslater" wrote in message ...
I have a column of date data that is in text format by design. I want
to do a find and replace for this column to change "/2003" to "/03",
"/2004" to "/04", etc. I have coded this into my macro, but Excel
automatically sets the cell format to a date type when the find and
replace occurs. Is there any way to stop this from happening? Can I
lock the format of these cells?

Thanks!



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 04:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com