Need formula for bolding value if >0


Posted by Noir on January 11, 2002 6:10 AM

My default value for A1 will be zero. Once i type any value in A1 (higher than zero), i would like that value to BOLD. If i decide to change the value back to zero, i would like to have the BOLD removed.

Unfortunately, i cannot use conditional formatting for this task. I will need to use a full formula.

Please advise.

Thanks,
Noir

Posted by Juan Pablo G. on January 11, 2002 6:16 AM

Why can't you use conditional formatting ? is A1 a value or a result of a formula ?

Juan Pablo G.

Posted by Aladin Akyurek on January 11, 2002 6:18 AM

Noir --

> Unfortunately, i cannot use conditional formatting for this task.

Just curious: Why not?

Aladin

=======

Posted by Noir on January 11, 2002 6:18 AM

:I am using a condensed version of Excel that does not offer C/F as a feature. However, it will accept many formulas.

Posted by Juan Pablo G. on January 11, 2002 6:19 AM

I read you "type" in A1, so here's some code to go in the Sheet's module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error Resume Next
Target.Font.Bold = (Target.Address = "$A$1") * (Target.Value > 0)
On Error GoTo 0
End Sub

Juan Pablo G.

Posted by Noir on January 11, 2002 6:34 AM

:It's not working. I must be doing something wrong. I tried it 2 ways. I tried adding the code to an existing module as well as adding a new module. Please advise.

Posted by Juan Pablo G. on January 11, 2002 6:40 AM

Close but no.

>so here's some code to go in the Sheet's module.

Right click on the sheet you're working on, select "View Code", and paste it there.

Juan Pablo G.



Posted by Noir on January 11, 2002 11:56 AM