ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macros don't work (https://www.excelbanter.com/excel-programming/343639-macros-dont-work.html)

alymcmorland[_10_]

macros don't work
 

hey,

i hope someone can help. Could you please give me reasons for m
macros not working, its nothing to do with the code, its something i
the excel program itself, when i run a macro nothing happens, its as i
an option has been switched off. So could you give me any reason othe
than duff macro code as to why the macro wouldn't work, for example i
you had macros switched off when you try and ran them they wouldn'
work.

Thank

--
alymcmorlan
-----------------------------------------------------------------------
alymcmorland's Profile: http://www.excelforum.com/member.php...fo&userid=2765
View this thread: http://www.excelforum.com/showthread.php?threadid=47871


Bob Phillips[_6_]

macros don't work
 
How do you know it is not the macros themselves?

Post the code and details of what you are trying to do.

--

HTH

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


"alymcmorland"
wrote in message
news:alymcmorland.1xeiee_1130148310.8663@excelforu m-nospam.com...

hey,

i hope someone can help. Could you please give me reasons for my
macros not working, its nothing to do with the code, its something in
the excel program itself, when i run a macro nothing happens, its as if
an option has been switched off. So could you give me any reason other
than duff macro code as to why the macro wouldn't work, for example if
you had macros switched off when you try and ran them they wouldn't
work.

Thanks


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

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




alymcmorland[_11_]

macros don't work
 

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


alymcmorland[_12_]

macros don't work
 

All i needed to know is if the code itself is faulty, but if you guy
can't see anything wrong with it then it has to be my excel playing up
In my mind these macros should work! Not to worry then.

Thank

--
alymcmorlan
-----------------------------------------------------------------------
alymcmorland's Profile: http://www.excelforum.com/member.php...fo&userid=2765
View this thread: http://www.excelforum.com/showthread.php?threadid=47871


Bob Phillips[_6_]

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





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com