Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
still having trouble
I am trying to insert additional logic here ******
Sub HiLite() For Each cll In Range("A:A") If cll.Value = "C" Or cll.Value = "c" Then If IsEmpty(cll.Offset(0, 1)) Then cll.Offset(0, 1).Interior.ColorIndex = 6 _ Else: cll.Offset(0, 1).Interior.ColorIndex = xlNone If IsEmpty(cll.Offset(0, 2)) Then cll.Offset(0, 2).Interior.ColorIndex = 6 _ Else: cll.Offset(0, 2).Interior.ColorIndex = xlNone ***** If cells R - U are ALL empty, then high-light. R - U; if ONE of them is NOT empty then NONE of the cells are high-lighted ********* End If Next End Sub Thanks for any help!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
still having trouble
Theo,
Maybe this Sub HiLite() For Each cll In Range("A1:A10") If cll.Value = "C" Or cll.Value = "c" Then If IsEmpty(cll.Offset(0, 1)) Then cll.Offset(0, 1).Interior.ColorIndex = 6 Else: cll.Offset(0, 1).Interior.ColorIndex = xlNone End If If IsEmpty(cll.Offset(0, 2)) Then cll.Offset(0, 2).Interior.ColorIndex = 6 Else: cll.Offset(0, 2).Interior.ColorIndex = xlNone End If Set myrange = Range(cll.Offset(0, 17), cll.Offset(0, 20)) For Each c In myrange If Not IsEmpty(c) Then myrange.Interior.ColorIndex = xlNone GoTo 100 End If Next myrange.Interior.ColorIndex = 6 100: End If Next End Sub Mike "Theo" wrote: I am trying to insert additional logic here ****** Sub HiLite() For Each cll In Range("A:A") If cll.Value = "C" Or cll.Value = "c" Then If IsEmpty(cll.Offset(0, 1)) Then cll.Offset(0, 1).Interior.ColorIndex = 6 _ Else: cll.Offset(0, 1).Interior.ColorIndex = xlNone If IsEmpty(cll.Offset(0, 2)) Then cll.Offset(0, 2).Interior.ColorIndex = 6 _ Else: cll.Offset(0, 2).Interior.ColorIndex = xlNone ***** If cells R - U are ALL empty, then high-light. R - U; if ONE of them is NOT empty then NONE of the cells are high-lighted ********* End If Next End Sub Thanks for any help!! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
still having trouble
Extremely fabulous!!
Thank you T "Mike H" wrote: Theo, Maybe this Sub HiLite() For Each cll In Range("A1:A10") If cll.Value = "C" Or cll.Value = "c" Then If IsEmpty(cll.Offset(0, 1)) Then cll.Offset(0, 1).Interior.ColorIndex = 6 Else: cll.Offset(0, 1).Interior.ColorIndex = xlNone End If If IsEmpty(cll.Offset(0, 2)) Then cll.Offset(0, 2).Interior.ColorIndex = 6 Else: cll.Offset(0, 2).Interior.ColorIndex = xlNone End If Set myrange = Range(cll.Offset(0, 17), cll.Offset(0, 20)) For Each c In myrange If Not IsEmpty(c) Then myrange.Interior.ColorIndex = xlNone GoTo 100 End If Next myrange.Interior.ColorIndex = 6 100: End If Next End Sub Mike "Theo" wrote: I am trying to insert additional logic here ****** Sub HiLite() For Each cll In Range("A:A") If cll.Value = "C" Or cll.Value = "c" Then If IsEmpty(cll.Offset(0, 1)) Then cll.Offset(0, 1).Interior.ColorIndex = 6 _ Else: cll.Offset(0, 1).Interior.ColorIndex = xlNone If IsEmpty(cll.Offset(0, 2)) Then cll.Offset(0, 2).Interior.ColorIndex = 6 _ Else: cll.Offset(0, 2).Interior.ColorIndex = xlNone ***** If cells R - U are ALL empty, then high-light. R - U; if ONE of them is NOT empty then NONE of the cells are high-lighted ********* End If Next End Sub Thanks for any help!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trouble with IF | Excel Worksheet Functions | |||
Still having trouble | Excel Discussion (Misc queries) | |||
Im in trouble!!! Please Help!! JS | Excel Discussion (Misc queries) | |||
still having trouble with this.... | Excel Worksheet Functions | |||
Trouble getting used to VBA | Excel Programming |