+ Reply to Thread
Results 1 to 3 of 3

Object doesnt support this property or method

Hybrid View

  1. #1
    Registered User
    Join Date
    02-09-2015
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    1

    Object doesnt support this property or method

    Hey Guys,

    New to the forum. All my other problems I've been able to work out. However I'm stuck on this code.

    I'm trying to format rows based on a word in a separate column. Not through conditional formatting.

    I found this code on another post which I have manipulated to what I want it to do, but I now get a run time error 438 when execute the code
    If I debug it highlights the following ".Font.ColourIndex = fc"

    A solution with an explanation would be much appreciated so I can learn from my mistake.

    Sub Find_First()
    
    Dim c As Range, d As Range, fc As Long, fb As Boolean
    
    Set d = Range("D5:D100")
    
    If d Is Nothing Then Exit Sub
    
    For Each c In d
        Select Case UCase(c)
            Case "HOLD"
                fc = 22: fb = False
            Case "CONSTRUCTION"
                fc = 41: fb = False
            Case "COMPLETE"
                fc = 15: fb = False
            Case "PROGRESSING"
                fc = 12: fb = False
            Case "DESIGN"
                fc = 1: fb = True
            Case Else
                fc = 1: fb = False
        End Select
        With Cells(c.Row, 1).Resize(, 4)
            .Font.ColourIndex = fc
            .Font.Bold = fb
        End With
    
    Next
    
    End Sub

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,996

    Re: Object doesnt support this property or method

    It's ColorIndex and not ColourIndex.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    02-09-2015
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    1

    Re: Object doesnt support this property or method

    Ah man. I'm such a noob. Haha. Thanks, had me stumped for days.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run-time error '438' object doesnt support this property or method
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2014, 03:20 AM
  2. object doesnt support this property or method
    By bsapaka in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-11-2014, 02:19 PM
  3. [SOLVED] Run time error 438, object doesnt support this property or method
    By 33CDonnelly in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-02-2013, 11:21 AM
  4. VBA Error: Object doesnt support the property or method
    By AntiPivotTable in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2013, 12:25 AM
  5. Object doesnt support this property or method- error
    By kiran527 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-13-2012, 09:39 AM

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