Results 1 to 3 of 3

Thread: macro to fill color in blank cells based on filtering values in other columns

  1. #1

    macro to fill color in blank cells based on filtering values in other columns



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi Champs,

    I have 3 column
    Col A - code
    Col B - Status
    Col C - Term

    i need to filter col A (only 1,2,7) and col C (only T and 36) and Col B (only blanks)

    the col B with blank cells has to be highlighted. Please refer the sample file with output attached

    Please helpsample.xlsx

  2. #2
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,512
    Articles
    0
    Excel Version
    365
    Code:
    Sub blah()
    With Range("A1")
      .AutoFilter Field:=1, Criteria1:=Array("1", "2", "7"), Operator:=xlFilterValues
      .AutoFilter Field:=3, Criteria1:="=36", Operator:=xlOr, Criteria2:="=T"
      .AutoFilter Field:=2, Criteria1:="="
      With ActiveSheet.AutoFilter.Range
        .Offset(1, 1).Resize(.Rows.Count - 1, 1).Interior.Color = 65535
      End With
      .AutoFilter
    End With
    End Sub

  3. #3
    Thanks for the code. works great

Posting Permissions

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