Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Find Replace loses text properties/formatting
Hello there,
My problem is as follows: I currently have a cell that is a merged cell, so it spans about 20 rows, (however when you click on it, it always shows one cell, ie, J14) and in the cell there is text which is bold, italic, underlined and normal. I wish to replace a word that is in bold in the cell, (ie changing N to Z), however, when using the find and replace it makes the whole cell bold. I guess what is the CODE, as i wish to code it, (or if worst comes to worst record a macro) for the find and replace to preserve the cell text properties/formatting. I thought Excel might have been smart enough to realise if text was bold then when you replace it, the text you replaces becomes bold too. Or if text was underlined and you replaced it, then the new text was underlined. Yeah? Currently my code works to replace the text but changes the formatting. Can anyone expand on it to help with code to preserve the contents. Sub findReplaceText() For Each mycell In Range("J4:J4") mycell.Replace What:="N", Replacement:="Z" Next End Sub Thanks in advance |
#2
|
|||
|
|||
When you open the replace dialog box there is an options button in the lower right corner.
Check to make sure there is not special formatting to the "replace" field. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot table loses its properties | Excel Discussion (Misc queries) | |||
find text in cell and replace it with part of the text in that ce. | Excel Discussion (Misc queries) | |||
Find and Replace formatting formats the ENTIRE cell | Excel Discussion (Misc queries) | |||
Concatenation formula loses text wrap formatting | Excel Discussion (Misc queries) |