Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
A new challenge for me!
I am entering different numbers in the same cell. I need the numbers to be a different color. Is it possible to have Excel do this? I have tried conditional formatting but I have a problem. If, for example, I want the number 1 to be red it will be red if it is the ONLY number in the cell. As soon as another number is entered, both are are the default color. I am hoping I can do this without putting everything in it's own separate cell. Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I believe formatting individual characters only works for text....not numbers.
Maybe try this?: Format the cells as Text. Then right-align them and change the individual character colors. Is that something you can work with? *********** Regards, Ron XL2002, WinXP "Patrick" wrote: A new challenge for me! I am entering different numbers in the same cell. I need the numbers to be a different color. Is it possible to have Excel do this? I have tried conditional formatting but I have a problem. If, for example, I want the number 1 to be red it will be red if it is the ONLY number in the cell. As soon as another number is entered, both are are the default color. I am hoping I can do this without putting everything in it's own separate cell. Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Assuming I did what you suggested, I did try formatting it as text but still
have the same problem. I guess I will just have to put everything in it's own cell! It just seems to me that there ought to be a way to say to Excel, "Hey, when you go to a cell and see three numbers, make them all the color that I want you to make them." I should have thought ahead! Thanks for chipping in. "Ron Coderre" wrote: I believe formatting individual characters only works for text....not numbers. Maybe try this?: Format the cells as Text. Then right-align them and change the individual character colors. Is that something you can work with? *********** Regards, Ron XL2002, WinXP "Patrick" wrote: A new challenge for me! I am entering different numbers in the same cell. I need the numbers to be a different color. Is it possible to have Excel do this? I have tried conditional formatting but I have a problem. If, for example, I want the number 1 to be red it will be red if it is the ONLY number in the cell. As soon as another number is entered, both are are the default color. I am hoping I can do this without putting everything in it's own separate cell. Thanks in advance |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Well.....my response was pretty much off the mark, but see if this one gets
you what you want.... No regular Excel formula can look at the contents of a cell the way you want it to. For example: If A1: =10/10 Then this formula =AND(A1=1,TEXT(A1,"general")="1") returns TRUE ....it can't "see" the actual contents. and this formula =CELL("contents",A1) returns 1 for the same reason. However....Maybe you could use a User Defined Function?: Put this code into a Genral Module... Function CellFormula(rngCell As range) As String Dim Bullpen As String If rngCell.Cells.Count = 1 Then Bullpen = CStr(rngCell.Formula) If Len(Bullpen) 0 Then CellFormula = Bullpen Else CellFormula = "(cell is empty)" End If Else CellFormula = "invalid range" End If End Function Then, for cell A1, the CF formula could be: =cellformula(A1)="1" and I think THAT would work. I hope that helps. *********** Regards, Ron XL2002, WinXP "Ron Coderre" wrote: I believe formatting individual characters only works for text....not numbers. Maybe try this?: Format the cells as Text. Then right-align them and change the individual character colors. Is that something you can work with? *********** Regards, Ron XL2002, WinXP "Patrick" wrote: A new challenge for me! I am entering different numbers in the same cell. I need the numbers to be a different color. Is it possible to have Excel do this? I have tried conditional formatting but I have a problem. If, for example, I want the number 1 to be red it will be red if it is the ONLY number in the cell. As soon as another number is entered, both are are the default color. I am hoping I can do this without putting everything in it's own separate cell. Thanks in advance |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Ron:
Thanks again. The good news is that this sounds GREAT! The "bad" news is it sounds way beyond what I know how to do. :) Maybe I could put what you want into a "general module" but at my level don't even know what that is or where I would find it. I'd love to try and do appreciate all of your input. In the meantime, I am transferring things to individual cells as a temporary fix. "Ron Coderre" wrote: Well.....my response was pretty much off the mark, but see if this one gets you what you want.... No regular Excel formula can look at the contents of a cell the way you want it to. For example: If A1: =10/10 Then this formula =AND(A1=1,TEXT(A1,"general")="1") returns TRUE ...it can't "see" the actual contents. and this formula =CELL("contents",A1) returns 1 for the same reason. However....Maybe you could use a User Defined Function?: Put this code into a Genral Module... Function CellFormula(rngCell As range) As String Dim Bullpen As String If rngCell.Cells.Count = 1 Then Bullpen = CStr(rngCell.Formula) If Len(Bullpen) 0 Then CellFormula = Bullpen Else CellFormula = "(cell is empty)" End If Else CellFormula = "invalid range" End If End Function Then, for cell A1, the CF formula could be: =cellformula(A1)="1" and I think THAT would work. I hope that helps. *********** Regards, Ron XL2002, WinXP "Ron Coderre" wrote: I believe formatting individual characters only works for text....not numbers. Maybe try this?: Format the cells as Text. Then right-align them and change the individual character colors. Is that something you can work with? *********** Regards, Ron XL2002, WinXP "Patrick" wrote: A new challenge for me! I am entering different numbers in the same cell. I need the numbers to be a different color. Is it possible to have Excel do this? I have tried conditional formatting but I have a problem. If, for example, I want the number 1 to be red it will be red if it is the ONLY number in the cell. As soon as another number is entered, both are are the default color. I am hoping I can do this without putting everything in it's own separate cell. Thanks in advance |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Please don't shy away from a tiny little pre-built formula just yet....
Try this: Hold down the [alt] key and press the [f11] key....that opens the vba editor Right-click on the workbook name Select: Insert module.....that will open a General Module Just copy this code and paste it into the module: '--------start of code-------- Function CellFormula(rngCell As range) As String Dim Bullpen As String If rngCell.Cells.Count = 1 Then Bullpen = CStr(rngCell.Formula) If Len(Bullpen) 0 Then CellFormula = Bullpen Else CellFormula = "(cell is empty)" End If Else CellFormula = "invalid range" End If End Function '--------end of code-------- That's it! Done! Now you can use the cellformula() function. Here's a way to test it: Put any value in cell A1 B1: =cellformula(A1) experiment with A1 values (easy...yes?) Is that something you can work with? *********** Regards, Ron XL2002, WinXP "Patrick" wrote: Ron: Thanks again. The good news is that this sounds GREAT! The "bad" news is it sounds way beyond what I know how to do. :) Maybe I could put what you want into a "general module" but at my level don't even know what that is or where I would find it. I'd love to try and do appreciate all of your input. In the meantime, I am transferring things to individual cells as a temporary fix. "Ron Coderre" wrote: Well.....my response was pretty much off the mark, but see if this one gets you what you want.... No regular Excel formula can look at the contents of a cell the way you want it to. For example: If A1: =10/10 Then this formula =AND(A1=1,TEXT(A1,"general")="1") returns TRUE ...it can't "see" the actual contents. and this formula =CELL("contents",A1) returns 1 for the same reason. However....Maybe you could use a User Defined Function?: Put this code into a Genral Module... Function CellFormula(rngCell As range) As String Dim Bullpen As String If rngCell.Cells.Count = 1 Then Bullpen = CStr(rngCell.Formula) If Len(Bullpen) 0 Then CellFormula = Bullpen Else CellFormula = "(cell is empty)" End If Else CellFormula = "invalid range" End If End Function Then, for cell A1, the CF formula could be: =cellformula(A1)="1" and I think THAT would work. I hope that helps. *********** Regards, Ron XL2002, WinXP "Ron Coderre" wrote: I believe formatting individual characters only works for text....not numbers. Maybe try this?: Format the cells as Text. Then right-align them and change the individual character colors. Is that something you can work with? *********** Regards, Ron XL2002, WinXP "Patrick" wrote: A new challenge for me! I am entering different numbers in the same cell. I need the numbers to be a different color. Is it possible to have Excel do this? I have tried conditional formatting but I have a problem. If, for example, I want the number 1 to be red it will be red if it is the ONLY number in the cell. As soon as another number is entered, both are are the default color. I am hoping I can do this without putting everything in it's own separate cell. Thanks in advance |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I will sure give it a try and let you know how it goes. Can't thank you
enough for your assistance! "Ron Coderre" wrote: Please don't shy away from a tiny little pre-built formula just yet.... Try this: Hold down the [alt] key and press the [f11] key....that opens the vba editor Right-click on the workbook name Select: Insert module.....that will open a General Module Just copy this code and paste it into the module: '--------start of code-------- Function CellFormula(rngCell As range) As String Dim Bullpen As String If rngCell.Cells.Count = 1 Then Bullpen = CStr(rngCell.Formula) If Len(Bullpen) 0 Then CellFormula = Bullpen Else CellFormula = "(cell is empty)" End If Else CellFormula = "invalid range" End If End Function '--------end of code-------- That's it! Done! Now you can use the cellformula() function. Here's a way to test it: Put any value in cell A1 B1: =cellformula(A1) experiment with A1 values (easy...yes?) Is that something you can work with? *********** Regards, Ron XL2002, WinXP "Patrick" wrote: Ron: Thanks again. The good news is that this sounds GREAT! The "bad" news is it sounds way beyond what I know how to do. :) Maybe I could put what you want into a "general module" but at my level don't even know what that is or where I would find it. I'd love to try and do appreciate all of your input. In the meantime, I am transferring things to individual cells as a temporary fix. "Ron Coderre" wrote: Well.....my response was pretty much off the mark, but see if this one gets you what you want.... No regular Excel formula can look at the contents of a cell the way you want it to. For example: If A1: =10/10 Then this formula =AND(A1=1,TEXT(A1,"general")="1") returns TRUE ...it can't "see" the actual contents. and this formula =CELL("contents",A1) returns 1 for the same reason. However....Maybe you could use a User Defined Function?: Put this code into a Genral Module... Function CellFormula(rngCell As range) As String Dim Bullpen As String If rngCell.Cells.Count = 1 Then Bullpen = CStr(rngCell.Formula) If Len(Bullpen) 0 Then CellFormula = Bullpen Else CellFormula = "(cell is empty)" End If Else CellFormula = "invalid range" End If End Function Then, for cell A1, the CF formula could be: =cellformula(A1)="1" and I think THAT would work. I hope that helps. *********** Regards, Ron XL2002, WinXP "Ron Coderre" wrote: I believe formatting individual characters only works for text....not numbers. Maybe try this?: Format the cells as Text. Then right-align them and change the individual character colors. Is that something you can work with? *********** Regards, Ron XL2002, WinXP "Patrick" wrote: A new challenge for me! I am entering different numbers in the same cell. I need the numbers to be a different color. Is it possible to have Excel do this? I have tried conditional formatting but I have a problem. If, for example, I want the number 1 to be red it will be red if it is the ONLY number in the cell. As soon as another number is entered, both are are the default color. I am hoping I can do this without putting everything in it's own separate cell. Thanks in advance |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Ron:
One more question if I might. Does the conditional formatting feature in Excel really limit me (as it appears to) to only three conditions? What if I have 20 numbers in a spreadsheet, all in their own cells, and I want to be able to see by looking at the sheet where all the numbers are by assigning them all their own color? I would think there would be any easy way to do this in Excel, but ... . "Ron Coderre" wrote: Please don't shy away from a tiny little pre-built formula just yet.... Try this: Hold down the [alt] key and press the [f11] key....that opens the vba editor Right-click on the workbook name Select: Insert module.....that will open a General Module Just copy this code and paste it into the module: '--------start of code-------- Function CellFormula(rngCell As range) As String Dim Bullpen As String If rngCell.Cells.Count = 1 Then Bullpen = CStr(rngCell.Formula) If Len(Bullpen) 0 Then CellFormula = Bullpen Else CellFormula = "(cell is empty)" End If Else CellFormula = "invalid range" End If End Function '--------end of code-------- That's it! Done! Now you can use the cellformula() function. Here's a way to test it: Put any value in cell A1 B1: =cellformula(A1) experiment with A1 values (easy...yes?) Is that something you can work with? *********** Regards, Ron XL2002, WinXP "Patrick" wrote: Ron: Thanks again. The good news is that this sounds GREAT! The "bad" news is it sounds way beyond what I know how to do. :) Maybe I could put what you want into a "general module" but at my level don't even know what that is or where I would find it. I'd love to try and do appreciate all of your input. In the meantime, I am transferring things to individual cells as a temporary fix. "Ron Coderre" wrote: Well.....my response was pretty much off the mark, but see if this one gets you what you want.... No regular Excel formula can look at the contents of a cell the way you want it to. For example: If A1: =10/10 Then this formula =AND(A1=1,TEXT(A1,"general")="1") returns TRUE ...it can't "see" the actual contents. and this formula =CELL("contents",A1) returns 1 for the same reason. However....Maybe you could use a User Defined Function?: Put this code into a Genral Module... Function CellFormula(rngCell As range) As String Dim Bullpen As String If rngCell.Cells.Count = 1 Then Bullpen = CStr(rngCell.Formula) If Len(Bullpen) 0 Then CellFormula = Bullpen Else CellFormula = "(cell is empty)" End If Else CellFormula = "invalid range" End If End Function Then, for cell A1, the CF formula could be: =cellformula(A1)="1" and I think THAT would work. I hope that helps. *********** Regards, Ron XL2002, WinXP "Ron Coderre" wrote: I believe formatting individual characters only works for text....not numbers. Maybe try this?: Format the cells as Text. Then right-align them and change the individual character colors. Is that something you can work with? *********** Regards, Ron XL2002, WinXP "Patrick" wrote: A new challenge for me! I am entering different numbers in the same cell. I need the numbers to be a different color. Is it possible to have Excel do this? I have tried conditional formatting but I have a problem. If, for example, I want the number 1 to be red it will be red if it is the ONLY number in the cell. As soon as another number is entered, both are are the default color. I am hoping I can do this without putting everything in it's own separate cell. Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional formatting if value in cell is found in a named range | Excel Worksheet Functions | |||
Cell Formatting Conditional On Other Cells Fill Color? | Excel Worksheet Functions | |||
Conditional Formatting For A Cell Other Than The One With The Form | Excel Worksheet Functions | |||
Transfer Cell Formatting for linked cells | Excel Discussion (Misc queries) | |||
xls worksheet formatting a single cell | Excel Discussion (Misc queries) |