LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Color code in 2 column conditional

Hi

I have a spreadsheet similar to this:

RJS JPM CLS CALL BU
VAC MTG CLS
MTG VAC VAC JPM
MTG VAC JPM


My code looks like this:

Sub ck_conflicts()

Dim rng As Range, cell As Range
Dim lastrow As Long
lastrow = Cells(Rows.Count, "K").End(xlUp).Row
Set rng = Range("K4:K" & lastrow)
For Each cell In rng 'offset is 7 columns
If (cell.Value = "RJS" And cell.Offset(0, -7).Value < "") Then
cell.Interior.ColorIndex = 3
MsgBox ("Conflict Found - Color Coded")
Else
MsgBox ("No Conflicts Found")
Exit Sub
End If
Next
End Sub


I am trying to look down each cell in the "Call" column (= K), and
identify where someone's initials are. I then want to look over to the
column where their initials are (same row) and see if the cell is empty
(ie, no conflicts). If there is a conflict, then color the cell. In the
example spreadsheet above, there is a conflict where JPM is listed in
the call column, but also listed as vacation (VAC). I can't see what is
wrong with my code snippet....


Thanks

CLS

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
color code series by an independent column of data rockdoc69 Charts and Charting in Excel 1 September 12th 08 10:54 AM
conditional formatting w/ more than 3 conditionas, color code to a different cell oldbarnes About this forum 0 May 24th 07 01:27 AM
How to conditional color a named range in VBA code mark engineer Excel Programming 1 October 31st 05 03:12 AM
Conditional formulas: color code text populated cells? TKT Excel Worksheet Functions 6 October 29th 05 02:15 AM
customizing chart column color formats in code Papa Jonah Excel Programming 1 March 21st 05 06:15 PM


All times are GMT +1. The time now is 08:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"