ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Find and Replace without changing font (https://www.excelbanter.com/excel-discussion-misc-queries/121995-find-replace-without-changing-font.html)

Tony Logan

Find and Replace without changing font
 
Let's say the content of a cell is something like this:
<tagabc</tag <tagdef</tag

And let's also say that strings "abc" and "def" are a different font than
the tags. Let's say the tags are Times New Roman while the strings between
tags are Arial.

When I do a find and replace to delete the space between "</tag <tag", the
font of my strings changes from Arial to Times New Roman.

Is there a way to prevent this from happening?

Using Excel 2003.


Richard O. Neville

Find and Replace without changing font
 
In the "Find and Replace" box click "Format," and you can search for a
particular format and replace it with the same format or a different one.
The entire "Format cells" menu is available when you click "Format." Even
spaces have font formats.

"Tony Logan" wrote in message
...
Let's say the content of a cell is something like this:
<tagabc</tag <tagdef</tag

And let's also say that strings "abc" and "def" are a different font than
the tags. Let's say the tags are Times New Roman while the strings between
tags are Arial.

When I do a find and replace to delete the space between "</tag <tag",
the
font of my strings changes from Arial to Times New Roman.

Is there a way to prevent this from happening?

Using Excel 2003.




Tony Logan

Find and Replace without changing font
 
Tried this but it didn't work. It still changes the font of the string
between tags as well, which I don't want to happen.

I need to be able to do the search and replace and keep the existing fonts
in the cell what they a tags in font A, and text between tags in font B.

Is there a way to do this?

Thanks.



"Richard O. Neville" wrote:

In the "Find and Replace" box click "Format," and you can search for a
particular format and replace it with the same format or a different one.
The entire "Format cells" menu is available when you click "Format." Even
spaces have font formats.

"Tony Logan" wrote in message
...
Let's say the content of a cell is something like this:
<tagabc</tag <tagdef</tag

And let's also say that strings "abc" and "def" are a different font than
the tags. Let's say the tags are Times New Roman while the strings between
tags are Arial.

When I do a find and replace to delete the space between "</tag <tag",
the
font of my strings changes from Arial to Times New Roman.

Is there a way to prevent this from happening?

Using Excel 2003.





Dave Peterson

Find and Replace without changing font
 
I think you'll have to look at each character and keep track of the font (and
all the other attributes???).

You may want to try this:
http://groups.google.co.uk/group/mic...ee5401f618fd94

or
http://snipurl.com/14omr



Tony Logan wrote:

Let's say the content of a cell is something like this:
<tagabc</tag <tagdef</tag

And let's also say that strings "abc" and "def" are a different font than
the tags. Let's say the tags are Times New Roman while the strings between
tags are Arial.

When I do a find and replace to delete the space between "</tag <tag", the
font of my strings changes from Arial to Times New Roman.

Is there a way to prevent this from happening?

Using Excel 2003.


--

Dave Peterson

Tony Logan

Find and Replace without changing font
 
Gave the code referenced in the below link a whirl, but I'm getting this
error: "Cannot define a Public user-defined type within an object module".

Don't know enough VBA to be able to correct it. Any ideas?

Thanks.


"Dave Peterson" wrote:

I think you'll have to look at each character and keep track of the font (and
all the other attributes???).

You may want to try this:
http://groups.google.co.uk/group/mic...ee5401f618fd94

or
http://snipurl.com/14omr



Tony Logan wrote:

Let's say the content of a cell is something like this:
<tagabc</tag <tagdef</tag

And let's also say that strings "abc" and "def" are a different font than
the tags. Let's say the tags are Times New Roman while the strings between
tags are Arial.

When I do a find and replace to delete the space between "</tag <tag", the
font of my strings changes from Arial to Times New Roman.

Is there a way to prevent this from happening?

Using Excel 2003.


--

Dave Peterson



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

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