티스토리 뷰

VBA

[Excel][VBA] SpecialCells

어린왕자1234 2021. 11. 25. 15:27

Range개체.SpecialCells (Type, Value)

Type Required XlCellType The cells to include.
Value Optional Variant If Type is either xlCellTypeConstants or xlCellTypeFormulas, this argument is used to determine which types of cells to include in the result. These values can be added together to return more than one type. The default is to select all constants or formulas, no matter what the type.

 

▶ XlCellType

xlCellTypeAllFormatConditions -4172 Cells of any format.
xlCellTypeAllValidation -4174 Cells having validation criteria.
xlCellTypeBlanks 4 Empty cells.
xlCellTypeComments -4144 Cells containing notes.
xlCellTypeConstants 2 Cells containing constants.
xlCellTypeFormulas -4123 Cells containing formulas.
xlCellTypeLastCell 11 The last cell in the used range.
xlCellTypeSameFormatConditions -4173 Cells having the same format.
xlCellTypeSameValidation -4175 Cells having the same validation criteria.
xlCellTypeVisible 12 All visible cells.
▶ XLSPECIALCELLSVALUE ENUMERATION (EXCEL)
xlErrors 16 Cells with errors.
xlLogical 4 Cells with logical values.
xlNumbers 1 Cells with numeric values.
xlTextValues 2 Cells with text.