View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default macros don't work

The first worked for me, but I may not have the same data as you.

You might want to try and bracket the tests to ensure you test as you
require, maybe

Sub Macro_ContractTermination()
Dim c As Range

For Each c In Range(ActiveCell, Cells(370, ActiveCell.Column))
If (c.Interior.ColorIndex = 15 Or _
c.Interior.ColorIndex < 0) And _
Len(c) = 0 And _
c.FormulaR1C1 = "" Then
c.Interior.ColorIndex = 56
End If

Next c

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"alymcmorland"
wrote in message
news:alymcmorland.1xel6c_1130151908.6202@excelforu m-nospam.com...

Can anyone see anything wrong with this code, because when i try execute
each one nothing happens and its as if i haven't executed anything at
all!


Code:
--------------------

Sub Macro_ContractTermination()
Dim c As Range


For Each c In Range(ActiveCell, Cells(370, ActiveCell.Column))
If c.Interior.ColorIndex = 15 Or c.Interior.ColorIndex < 0 And Len(c) =

0 And c.FormulaR1C1 = "" Then
c.Interior.ColorIndex = 56
End If

Next c

End Sub


Sub Macro_ContractReinablation()
Dim c As Range


For Each c In Range(ActiveCell, Cells(370, ActiveCell.Column))
If c.Interior.ColorIndex = 56 Or c.Interior.ColorIndex < 0 And Len(c) =

0 And c.FormulaR1C1 = "" Then
c.Interior.ColorIndex = 15
End If

Next c

End Sub


Sub Macro_BankHoliday()
Dim c As Range


For Each c In Range(Cells(ActiveCell.Row, 4), Cells(ActiveCell.Row, 56))
If c.Interior.ColorIndex = 56 Or c.Interior.ColorIndex < 0 And Len(c) =

0 And c.FormulaR1C1 = "" Then
c.Interior.ColorIndex = 15
End If

Next c

End Sub


Sub Macro_WorkingDay()
Dim c As Range


For Each c In Range(Cells(ActiveCell.Row, 4), Cells(ActiveCell.Row, 56))
If c.Interior.ColorIndex = 15 Or c.Interior.ColorIndex < 0 And Len(c) =

0 And c.FormulaR1C1 = "" Then
c.Interior.ColorIndex = 56
End If

Next c

End Sub


--------------------


--
alymcmorland
------------------------------------------------------------------------
alymcmorland's Profile:

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