+ Reply to Thread
Results 1 to 3 of 3

Run time error 424

Hybrid View

  1. #1
    Registered User
    Join Date
    10-06-2011
    Location
    India, Chennai
    MS-Off Ver
    Excel 2003 (in Office) Excel 2007 (in Home)
    Posts
    21

    Run time error 424

    Hi All,

    This script suddenly not working.Yesterday it was working with excel 2007, now am using with excel 2003.its throwing error ("Run time error 424").


    Sub ColourCell()
    'Colour cell in range and 1 next to it if it meets criteria
    Dim cell As Range
    For Each cell In Range("E2:E25500")
    If cell.Value = 5 Then
    cell.Interior.Color = XlRgbColor.rgbRed
    ElseIf cell.Value = 4 Then
    cell.Interior.Color = XlRgbColor.rgbOrange
    ElseIf cell.Value = 3 Then
    cell.Interior.Color = XlRgbColor.rgbGold
    ElseIf cell.Value = 2 Then
    cell.Interior.Color = XlRgbColor.rgbYellow
    ElseIf cell.Value = 1 Then
    cell.Interior.Color = XlRgbColor.rgbLightYellow
    End If
    
    Next cell
    
    End Sub

    Error!!!!!

    ("Run time error 424").


    Poiting the line -> "cell.Interior.Color = XlRgbColor.rgbYellow"

    could you pls help me to resolve it, only after solving this issue i can try the next code thhat you gave above
    Last edited by Mordred; 10-07-2011 at 02:55 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Run time error 424

    Read up some more on this error. This is what i found online -

    http://www.pcaholic.com/blog-compute...ime-error-424/

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,167

    Re: Run time error 424

    I don't think those constants are defined/available in Excel 2003.

    In Excel 2007:

    ?xlrgbcolor.rgbRed
    255
    ?xlrgbcolor.rgborange
    42495
    ?xlrgbcolor.rgbgold
    55295
    ?xlrgbcolor.rgbyellow
    65535
    ?xlrgbcolor.rgblightyellow
    14745599

    You could try changing the values to those listed above. No guarantees though.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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