General discussion

Locked

MICROSOFT EXCEL CELL FORMAT

By BRADLEY.MURRAY ·
IS IT POSSIBLE TO RETURN THE RESULT OF A FORMULA IN THE EXACT FORMAT FROM THE CELL IN WHICH THE ANSWER WAS DERIVED FROM? MY SITUATION IS AS FOLLOWS, I HAVE A TABLE SET UP THAT CONTAINS BOTH NUMERIC AND ALPHA CHARACTERS. IN THE TABLE, THE CHARACTERS THAT ARE ALPHA ARE FORMATTED IN RED. EXAMPLE, S16 APPEARS WITH THE "S" IN RED AND 16 IN BLACK (I SIMPLY HIGHLIGHTED THE LETTER "S" IN THE FORMULA BAR AND SELECTED THE FONT COLOR RED). WHEN I PERFORM A VLOOKUP FUNCTION, I WANT THE RESULT TO APPEARTHE EXACT SAME WAY, I.E I WANT THE "S" TO BE RED, AND THE NUMBER 16 TO BE BLACK.

IS THIS POSSIBLE? HELP!!

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

MICROSOFT EXCEL CELL FORMAT

by Shanghai Sam In reply to MICROSOFT EXCEL CELL FORM ...

It will have to be with a macro. There aren't any worksheet functions that deal with colors, especially individual characters.
Chip Pearson has a good description at:

www.cpearson.com/excel/colors.htm

(There are no spaces in the URL)

Here's a start. This macro colors the first character in the cell Blue and displays a Message box, Then it colors all the other characters red.
Maybe you can combine some of these suggestions.

Sub FirstBlueRestRed()
ActiveCell.Characters(1, 1).Font.ColorIndex = 5
MsgBox ActiveCell.Characters(1, 1).Font.ColorIndex
ActiveCell.Characters(2).Font.ColorIndex = 3
MsgBox ActiveCell.Characters(2).Font.ColorIndex
End Sub

Back to Desktop Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums