Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Find and Replace Text

Here is my problem. I have the following text replicated hundreds of times
throughout my spreadsheet. 'Oct 2003 and 'Nov 2003 and other similar text
strings. I would like to do a find and replace on the year 2003 to 2004. When
I do this Excel changes the cell from text to date. How do I keep Excel from
doing this. Note that the cell must remain as text and that I can not just
reformat the cell as the string is a dimension name in an external OLAP cube,
that Excel References...

Thanks in Advance
Jim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Find and Replace Text

Hi
try formating these cells as 'Text' before replacing them.

--
Regards
Frank Kabel
Frankfurt, Germany


Jim Thomlinson wrote:
Here is my problem. I have the following text replicated hundreds of
times throughout my spreadsheet. 'Oct 2003 and 'Nov 2003 and other
similar text strings. I would like to do a find and replace on the
year 2003 to 2004. When I do this Excel changes the cell from text to
date. How do I keep Excel from doing this. Note that the cell must
remain as text and that I can not just reformat the cell as the
string is a dimension name in an external OLAP cube, that Excel
References...

Thanks in Advance
Jim


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Find and Replace Text

If each "date" cell had originally been entered with an apostrophe
(literally 'October 2003) then I find a Find/Replace does not change it to a
date formatted cell (unlike a cell that is merely text formatted). So I
gather that it was not so entered (not surprisingly).

If you find that that is true also and you want to convert your date cells
to have a leading apostrophe, here's a quick and dirty macro to do that:

Sub a()
Dim Cell As Range
For Each Cell In Cells.SpecialCells(xlCellTypeConstants, xlTextValues)
If Cell.Value Like "* 2003" Then
Cell.Value = "'" & Cell.Value
End If
Next
End Sub


--
Jim Rech
Excel MVP
"Jim Thomlinson" wrote in message
...
| Here is my problem. I have the following text replicated hundreds of times
| throughout my spreadsheet. 'Oct 2003 and 'Nov 2003 and other similar
text
| strings. I would like to do a find and replace on the year 2003 to 2004.
When
| I do this Excel changes the cell from text to date. How do I keep Excel
from
| doing this. Note that the cell must remain as text and that I can not just
| reformat the cell as the string is a dimension name in an external OLAP
cube,
| that Excel References...
|
| Thanks in Advance
| Jim


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Find and Replace Text

It generally works. My problem now revolves around there are times that I
have to do this where it is not feasable to reformat the cells as they are
intermingled with cells that I do not want to change the fromatting on. Any
bright ideas?

"Frank Kabel" wrote:

Hi
try formating these cells as 'Text' before replacing them.

--
Regards
Frank Kabel
Frankfurt, Germany


Jim Thomlinson wrote:
Here is my problem. I have the following text replicated hundreds of
times throughout my spreadsheet. 'Oct 2003 and 'Nov 2003 and other
similar text strings. I would like to do a find and replace on the
year 2003 to 2004. When I do this Excel changes the cell from text to
date. How do I keep Excel from doing this. Note that the cell must
remain as text and that I can not just reformat the cell as the
string is a dimension name in an external OLAP cube, that Excel
References...

Thanks in Advance
Jim



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find part text, replace all text anduare2 Excel Discussion (Misc queries) 2 May 26th 09 07:43 PM
Find & replace with text Waheeda Ali Excel Discussion (Misc queries) 2 January 27th 09 06:52 PM
Replace can't find text dac Excel Discussion (Misc queries) 1 October 26th 07 10:26 PM
find text in cell and replace it with part of the text in that ce. jules Excel Discussion (Misc queries) 3 May 3rd 07 10:18 AM
Find & Replace in Text Box Ed Excel Discussion (Misc queries) 10 March 28th 07 03:03 AM


All times are GMT +1. The time now is 11:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"