View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Muhammed Rafeek M Muhammed Rafeek M is offline
external usenet poster
 
Posts: 179
Default How to create a conditional format that changes the number format

write small code in a particular worksheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$10" And Target.Value = 20 Then
Target.NumberFormat = "00.00"
Else
Target.NumberFormat = "00"
End If
End Sub

'Target.Address = "$D$10" And Target.Value = 20 - example cell address $D$10
and value 10
'example format: Target.NumberFormat = "00.00"


"tmbo" wrote:


Hi

I am wondering if it is possible to change the number format of a
column of values depending on a cell that says true or false.

I would like to be able to specify it like a conditional fromat.

I know you can do something in custom number format but as far as I
know this will only evaluate the condition on the current cell value.

Any help would be most appreciated.


--
tmbo
------------------------------------------------------------------------
tmbo's Profile: http://www.excelforum.com/member.php...o&userid=37214
View this thread: http://www.excelforum.com/showthread...hreadid=574469