PDA

View Full Version : conditional formating



Kilroy
03-16-2020, 07:21 PM
I have a spreadsheet that uses conditional formatting (Colour scales) on 4 sets of two adjacent columns using colour scales (I&J,K&L, .M&N, O&P) Is there a way to colour and insert specific text in another cell if they don’t match?


For example If I&J don’t match add text to cell R on that same row and then add more text to cell R if K&L don’t match and same for M&N and O&P?






Any help appreciated, not sure where to even start.

Kalpesh
04-13-2020, 03:15 AM
I am trying to write a VBA Function code to highlight Odd and Even numbers. But not having much luck. Can anyone help me, please?

I would like to use following condition to highlight a cell:

=AND(ISODD(A1), A1<24) for Low-Odds
=AND(ISODD(A1), A1>24) for Low-Evens
=AND(ISEVEN(A1), A1<23) for High-Odds
=AND(ISEVEN(A1), A1>23) for High-Evens

paulked
04-13-2020, 08:48 AM
For example If I&J don’t match

What don't match? The whole column or adjacent cells, eg I2 & J2?

paulked
04-13-2020, 08:49 AM
@ Kalpesh:

Welcome to the forum, but please don't hijack other threads... start a new one.

paulked
04-13-2020, 09:14 AM
Taking a guess, copy this into the workbook module and try.



Private Sub Worksheet_Change(ByVal Target As Range)
Dim rw As Long, cl As Long, msg As String
rw = Target.Row
cl = Target.Column
If cl < 9 Or cl > 16 Then Exit Sub
If Cells(rw, 9) <> Cells(rw, 10) Then msg = "I&J "
If Cells(rw, 11) <> Cells(rw, 12) Then msg = msg & "K&L "
If Cells(rw, 13) <> Cells(rw, 14) Then msg = msg & "M&N "
If Cells(rw, 15) <> Cells(rw, 16) Then msg = msg & "O&P "
Cells(rw, 18) = msg
End Sub

Kalpesh
04-13-2020, 03:48 PM
Sorry mate, I didn't know how to post a new thread. How can delete my reply thread?

paulked
04-13-2020, 04:00 PM
Go to the forum home page here (http://www.vbaexpress.com/forum/forumdisplay.php?17-Excel-Help) and click + Post New Thread
26323