Results 1 to 2 of 2

Thread: [RESOLVED] color change the entire rows

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Resolved [RESOLVED] color change the entire rows

    hi!
    i am trying to do if the column 3 is blank and other coloumns 1 , 2 have values the entire row will be yellow color
    column 1 is text and column 2 will be variant and column 3 also vairant
    but the below will get error type mismatch.

    Code:
    If ActiveSheet.Cells(i, 1).Text And ActiveSheet.Cells(i, 2).Text And ActiveSheet.Cells(i, 3).Text = "" Then   ''color because was late
                            Range(Cells(i, 1), Cells(i, 3)).Interior.ColorIndex = 36   '
                     End If

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: color change the entire rows

    You can't just place a String value (.Text) in an If statement without any conditions - you need to put something for it to check.

    You could make sure that it doesn't equal an empty string:
    Code:
    If ActiveSheet.Cells(i, 1).Text <> "" And ...
    ...or that it is Not equal to an empty string:
    Code:
    If Not(ActiveSheet.Cells(i, 1).Text = "") And ...

Posting Permissions

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



Click Here to Expand Forum to Full Width