Using "IF" statements

S

Steven

If a returned value=true, how can I change the background color and font?
Can I also add a audio alarm if value=true?
 
S

Steve

You could use conditional formatting

Format, Conditional Formatting
Cell value is, equal to, TRUE

Select your Font and Background colour.

There's no provision for sound.

The alternative is VBA code to test a range of cells

Sub HighlightTrue()
Dim C As Range
For Each C In Selection
If C.Value = True Then
C.Interior.ColorIndex = 6
C.Font.ColorIndex = 46
Beep
Else
C.Interior.ColorIndex = 0
C.Font.ColorIndex = 1
End If
Next C
End Sub

HTH
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top