Propriedade CellFormat.Interior (Excel)

Retorna um objeto Interior permitindo que o usuário defina ou retorne os critérios de pesquisa com base no formato interno da célula.

Sintaxe

expressão. Interior

Expressão Uma variável que representa um objeto CellFormat .

Exemplo

Este exemplo define os critérios de pesquisa para identificar as células que contenham um interior amarelo sólido, cria uma célula com essa condição, localiza-a e notifica o usuário.

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

Suporte e comentários

Tem dúvidas ou quer enviar comentários sobre o VBA para Office ou sobre esta documentação? Confira Suporte e comentários sobre o VBA para Office a fim de obter orientação sobre as maneiras pelas quais você pode receber suporte e fornecer comentários.