Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Formula Conditional formatting on numbers
I need to format a number in a cell depending on the contents of a different
cell. Some cells will have two decimals, some none, depending on the contents of their adjacent cells. Conditional formatting. Formula Is. Allows me to change the font, border, pattern etc. but not the number format. Is it possible to do ? Thanks, Antonio |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Formula Conditional formatting on numbers
You can do that with a VBA event proc.
HTH -- AP "Antonio" a écrit dans le message de news: ... I need to format a number in a cell depending on the contents of a different cell. Some cells will have two decimals, some none, depending on the contents of their adjacent cells. Conditional formatting. Formula Is. Allows me to change the font, border, pattern etc. but not the number format. Is it possible to do ? Thanks, Antonio |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Formula Conditional formatting on numbers
Hi Ardus,
Which event would you use and how? Are you thinking of the SheetChange event? Thanks, Antonio "Ardus Petus" wrote: You can do that with a VBA event proc. HTH -- AP "Antonio" a écrit dans le message de news: ... I need to format a number in a cell depending on the contents of a different cell. Some cells will have two decimals, some none, depending on the contents of their adjacent cells. Conditional formatting. Formula Is. Allows me to change the font, border, pattern etc. but not the number format. Is it possible to do ? Thanks, Antonio |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Formula Conditional formatting on numbers
http://cjoint.com/?gehpMSd6M4 Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([B2:B1000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False For Each c In Range("MesCouleurs") If Target.Value c.Value Then c.Copy Target.PasteSpecial Paste:=xlPasteFormats End If Next c Application.EnableEvents = True End If End Sub Cordialy JB Antonio a écrit : I need to format a number in a cell depending on the contents of a different cell. Some cells will have two decimals, some none, depending on the contents of their adjacent cells. Conditional formatting. Formula Is. Allows me to change the font, border, pattern etc. but not the number format. Is it possible to do ? Thanks, Antonio |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Formula Conditional formatting on numbers
Hi JB and Ardus,
Thank you again for your idea that works perfectly. One question though, isn't worksheet_change routine very demanding on computer resources and might slow down the sheet substantially (at least in my case)? I will test it tomorrow when the servers are up but since I have many cells being updated every few split seconds with live market feeds, I wonder if each update will call the worksheet_change event. Even though the vast majority will not execute more than a couple of lines, this continuous checking sounds two much additional computing work. Regards, Antonio "JB" wrote: http://cjoint.com/?gehpMSd6M4 Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([B2:B1000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False For Each c In Range("MesCouleurs") If Target.Value c.Value Then c.Copy Target.PasteSpecial Paste:=xlPasteFormats End If Next c Application.EnableEvents = True End If End Sub Cordialy JB Antonio a écrit : I need to format a number in a cell depending on the contents of a different cell. Some cells will have two decimals, some none, depending on the contents of their adjacent cells. Conditional formatting. Formula Is. Allows me to change the font, border, pattern etc. but not the number format. Is it possible to do ? Thanks, Antonio |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Formula Conditional formatting on numbers
Resources for this programs are slow, less for conditional
formatting(there is no formule ) New version: http://cjoint.com/?getJyia8J7 Another sample: http://www.excelabo.net/compteclic.p...barrecoloriage http://www.excelabo.net/compteclic.p...ngmensuelmacro Cordialy JB Antonio a écrit : Hi JB and Ardus, Thank you again for your idea that works perfectly. One question though, isn't worksheet_change routine very demanding on computer resources and might slow down the sheet substantially (at least in my case)? I will test it tomorrow when the servers are up but since I have many cells being updated every few split seconds with live market feeds, I wonder if each update will call the worksheet_change event. Even though the vast majority will not execute more than a couple of lines, this continuous checking sounds two much additional computing work. Regards, Antonio "JB" wrote: http://cjoint.com/?gehpMSd6M4 Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([B2:B1000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False For Each c In Range("MesCouleurs") If Target.Value c.Value Then c.Copy Target.PasteSpecial Paste:=xlPasteFormats End If Next c Application.EnableEvents = True End If End Sub Cordialy JB Antonio a écrit : I need to format a number in a cell depending on the contents of a different cell. Some cells will have two decimals, some none, depending on the contents of their adjacent cells. Conditional formatting. Formula Is. Allows me to change the font, border, pattern etc. but not the number format. Is it possible to do ? Thanks, Antonio |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula Problem - interrupted by #VALUE! in other cells!? | Excel Worksheet Functions | |||
need a conditional formula to generate numbers divisible by 4 between a given starting no. & end No. | Excel Worksheet Functions | |||
Conditional Formatting - Formula based | Excel Worksheet Functions | |||
conditional formatting with FORMULA... Please HELP! | Excel Discussion (Misc queries) | |||
Need conditional formatting formula to highlight top ten values i. | Excel Worksheet Functions |