Yes, the row highlight is correct.
but is there a way to do include the range of cells that the X is in?
For instance, If I clickd on cell E17 the entire row 17 is highlighted, the driver can not get more points from that row, it's done... but the Columns C16 though E18 are also done because the driver can not receive more that 1 Best points for ET in one visit.
so basicly the row is done as well as the tic-tac-toe block of cells for ET.
The Conditional format formuls is
=(COUNTIF($C$16:$E$18,"X" & COUNTIF($C$17:$Q$17,"X")=1))
of course this does not work correctly, but thats the Idea.
I attached the sheet with your code, my addition with the 3 max and the conditional format that works with your VB
on what I am trying to do in VB
I added the ability to limit the X to 3 for the ET Group, but can't figure ouy how to look throught other catagory items (60 and light)
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("C16:Q24,C40:Q48,C64:Q72,C88:Q96,C112:Q120,C136:Q144,C160:Q168,C184:Q192,C208:Q216,C232:Q240,C256:Q264,C280:Q288,C304:Q312,C328:Q336,C352:Q360,C376:Q384,C400:Q408,C424:Q432,C448:Q456,C472:Q480")) Is Nothing Then
If Target = "X" Then
Target = ""
Range("B" & Target.Row & ":Q" & Target.Row).Interior.Color = xlNone
GoTo Ender
End If
If Target = "" Then
Target = "X"
Range("B" & Target.Row & ":Q" & Target.Row).Interior.Color = vbMagenta
End If
End If
If WorksheetFunction.CountIf(Range("C16:Q18"), "X") > 3 Then
Target.ClearContents
MsgBox "Maximum of 3 Bests for this catagory"
End If
Ender:
Cancel = True
End Sub
Anyway to put that if workstationFunction.countif ( into the if target section?
Bookmarks