ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   formatting a specific character or number in each cell within a rangeof cells (https://www.excelbanter.com/excel-programming/339804-formatting-specific-character-number-each-cell-within-rangeof-cells.html)

Colleen[_3_]

formatting a specific character or number in each cell within a rangeof cells
 
I am sending this to several Excel newsgroups, because I am not sure
which one if the most appropriate. I apologize in advance for the
multiple postings. I have MS Excel 2000 (version 9.0.3821 SR-1). How
can I format only a selected character or number within each cell in a
specific range of cells? For instance if I have a cell containing
“1234234”, how can I format it so that only the 2’s are bold or are
colored? Obviously, I have a range of cells, and I want to format all
the 2’s occurring in any of the cells as either bold or colored.
Conditional formatting does not seem to allow me to do this, and I have
been unable to find a formula that will accomplish this. Can someone help?
Thank you.
Colleen

Tom Ogilvy

formatting a specific character or number in each cell within a range of cells
 
this is called rich text formatting and can only be done manually or using
VBA code.

Manually, edit the cell, in the formula bar, highlight the 2 and format it.

Turn on the macro recorder while you do it manually if you need code. Then
generalize the code.

cell values produced through formulas can not be Rich Text formatted.

--
Regards,
Tom Ogilvy

"Colleen" wrote in message
ink.net...
I am sending this to several Excel newsgroups, because I am not sure
which one if the most appropriate. I apologize in advance for the
multiple postings. I have MS Excel 2000 (version 9.0.3821 SR-1). How
can I format only a selected character or number within each cell in a
specific range of cells? For instance if I have a cell containing
“1234234”, how can I format it so that only the 2’s are bold or are
colored? Obviously, I have a range of cells, and I want to format all
the 2’s occurring in any of the cells as either bold or colored.
Conditional formatting does not seem to allow me to do this, and I have
been unable to find a formula that will accomplish this. Can someone

help?
Thank you.
Colleen




Bernie Workman

formatting a specific character or number in each cell within a range of cells
 
I have tried to format characters within a cell as you suggested, and
the formatting does occur while I am editing the cells, but as soon as I
exit the cell, formatting is lost.

Can someone explain why?

Thanks,
Bernie





*** Sent via Developersdex http://www.developersdex.com ***

Dave Peterson

formatting a specific character or number in each cell within arange of cells
 
If the cell is a number (not a text number), then you can't use this kind of
formatting.

So preformat the cell as text
type the value
do the character by character formatting.

Entering the value with a leading apostrophe will make excel treat the value as
text, too.

'12345

(ps. This kind of formatting can't be used on formulas, too.)

Bernie Workman wrote:

I have tried to format characters within a cell as you suggested, and
the formatting does occur while I am editing the cells, but as soon as I
exit the cell, formatting is lost.

Can someone explain why?

Thanks,
Bernie

*** Sent via Developersdex http://www.developersdex.com ***


--

Dave Peterson

b w

formatting a specific character or number in each cell within a range of cells
 
Thanks Dave.

It works fine with Text.

Bernie



*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 12:19 AM.

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