Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Interior Property


This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.  

Returns an Interior object allowing the user to set or return the search criteria based on the cell's interior format.

expression.Interior

expression   Required. An expression that returns one of the above objects.

Returns an Interior object that represents the interior of the specified object.

expression.Interior

expression   Required. An expression that returns one of the above objects.

Example

This example sets the search criteria to identify cells that contain a solid yellow interior, creates a cell with this condition, finds this cell, and notifies the user.

Sub SearchCellFormat()

    ' Set the search criteria for the interior of the cell format.
    With Application.FindFormat.Interior
        .ColorIndex = 6
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
    End With

    ' Create a yellow interior for cell A5.
    Range("A5").Select
    With Selection.Interior
        .ColorIndex = 6
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
    End With
    Range("A1").Select
    MsgBox "Cell A5 has a yellow interior."

    ' Find the cells based on the search criteria.
    Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
        , SearchFormat:=True).Activate
    MsgBox "Microsoft Excel has found this cell matching the search criteria."

End Sub

This example sets the interior color for cell A1 on Sheet1 to cyan.

Sub SetColor()

    Worksheets("Sheet1").Range("A1").Interior.ColorIndex = 8  ' Cyan

End Sub
Show: