ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   conditional formating (https://www.excelbanter.com/excel-programming/370995-conditional-formating.html)

b166er[_5_]

conditional formating
 

hi members

in excel we can perform 4 condiional formating but i need to perfor
20 any way is there any way in vba i could do that please send me cod
if that possible

--
b166e
-----------------------------------------------------------------------
b166er's Profile: http://www.excelforum.com/member.php...fo&userid=3491
View this thread: http://www.excelforum.com/showthread.php?threadid=57377


Excelenator[_51_]

conditional formating
 

There is a way, however, you need to provide your 20 conditions and wha
triggers them in order to get any useful help here

--
Excelenato

-----------------------------------------------------------------------
Excelenator's Profile: http://www.excelforum.com/member.php...fo&userid=3676
View this thread: http://www.excelforum.com/showthread.php?threadid=57377


Bob Phillips

conditional formating
 
as an example


'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "H1:H10"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Value
Case 1: .Interior.ColorIndex = 3 'red
Case 2: .Interior.ColorIndex = 6 'yellow
Case 3: .Interior.ColorIndex = 5 'blue
Case 4: .Interior.ColorIndex = 10 'green
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"b166er" wrote in
message ...

hi members

in excel we can perform 4 condiional formating but i need to perform
20 any way is there any way in vba i could do that please send me code
if that possible.


--
b166er
------------------------------------------------------------------------
b166er's Profile:

http://www.excelforum.com/member.php...o&userid=34912
View this thread: http://www.excelforum.com/showthread...hreadid=573775





All times are GMT +1. The time now is 06:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com