• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

MS Excel - Quick question about Conditional Formatting.

Shagga

Diamond Member
Is it possible to use more than 3 Conditional formats per cell. I need 4. (Typical)

Iv'e tried to do it using VB but I keep getting an error when I implement the 4th Condition. 🙁 It just doesn't like it at all. Under the Format --> Conditional Formatting selection in Excel you only get 3 options.

Would appreciate some divine inspiration here please..

😉
 
I don't know what kind of formatting you are trying to apply, or what conditions you are using but here's some VBA code that will allow you to add a number of conditions. (Granted at the moment they're all number ranges).



<<
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim MyColor As Integer
Dim ApplyColor As Boolean

On Error GoTo NotANumber

'Limit it to certain columns
'4, 5, &amp; 7 are D, E, &amp; G
Select Case Target.Column
Case 4, 5, 7
ApplyColor = True
Case Else
ApplyColor = False
End Select

If ApplyColor Then
Select Case Target.Value
Case Is <= 10
MyColor = 5
Case 11 To 20
MyColor = 6
Case 21 To 30
MyColor = 7
Case 31 To 40
MyColor = 8
End Select
End If

Target.Font.ColorIndex = MyColor

NotANumber:
'Don't do anything cause it's not a number

End Sub
>>



This might help put you on the right track.

I couldn't figure out a way to do it using the Conditional Formatting menu selections.

If you have any questions PM me or post here.

I'm not on all the time, but do check periodically throughout the day.

- TK

P.S. Sorry about the code...HTML removed all of the extra spaces..thus eliminating all of my pretty indents. 😉 But I think you can still get the idea.
 
I think you have to do some of your conditions in another cell. Then link your final destination cell to your &quot;temp&quot; cell to complete your remaining conditions and display the final answer. Put the temp cell on another page and link to it so you don't mess up print or page formatting.
 
Back
Top