Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Antonio
 
Posts: n/a
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.misc
Antonio
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
JB
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Antonio
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
JB
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
need a conditional formula to generate numbers divisible by 4 between a given starting no. & end No. ramana Excel Worksheet Functions 5 October 21st 05 07:39 AM
Conditional Formatting - Formula based Nick Danger Excel Worksheet Functions 4 October 10th 05 06:40 PM
conditional formatting with FORMULA... Please HELP! Chris M Excel Discussion (Misc queries) 1 August 20th 05 12:28 AM
Need conditional formatting formula to highlight top ten values i. lightninbug Excel Worksheet Functions 11 January 20th 05 05:33 PM


All times are GMT +1. The time now is 03:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"