+ Reply to Thread
Results 1 to 5 of 5

macros don't work

Hybrid View

  1. #1
    Registered User
    Join Date
    09-29-2005
    Posts
    28

    macros don't work

    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

  2. #2
    Registered User
    Join Date
    09-29-2005
    Posts
    28
    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!

    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

  3. #3
    Bob Phillips
    Guest

    Re: 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" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > 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
    >




  4. #4
    Bob Phillips
    Guest

    Re: 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" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > 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
    >




  5. #5
    Registered User
    Join Date
    09-29-2005
    Posts
    28
    All i needed to know is if the code itself is faulty, but if you guys 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.

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1