Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 3
Default 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   Report Post  
Junior Member
 
Posts: 15
Default

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
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
Pivot table loses its properties Dan Excel Discussion (Misc queries) 0 January 23rd 08 02:04 AM
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 and Replace formatting formats the ENTIRE cell Duy Nguyen Excel Discussion (Misc queries) 2 April 16th 07 02:28 PM
Concatenation formula loses text wrap formatting DFM Excel Discussion (Misc queries) 5 December 27th 04 01:45 PM


All times are GMT +1. The time now is 12:28 PM.

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"