XmlMappedRange.SpecialCells(XlCellType, Object) メソッド

定義

指定した種類および値に一致するすべてのセルを表す Range を取得します。

public Microsoft.Office.Interop.Excel.Range SpecialCells (Microsoft.Office.Interop.Excel.XlCellType Type, object Value);
abstract member SpecialCells : Microsoft.Office.Interop.Excel.XlCellType * obj -> Microsoft.Office.Interop.Excel.Range
Public Function SpecialCells (Type As XlCellType, Optional Value As Object) As Range

パラメーター

Type
XlCellType

含めるセル。次のいずれかの値をXlCellType指定できます。 xlCellTypeAllFormatConditions 任意の書式のセルです。 xlCellTypeAllValidation. 入力規則の条件を持つセルです。 xlCellTypeBlanks. 空白セルです。 xlCellTypeComments. メモが含まれているセルです。 xlCellTypeConstants. 定数が含まれているセルです。 xlCellTypeFormulas. 数式が含まれているセルです。 xlCellTypeLastCell. 使用された範囲の最後のセルです。 xlCellTypeSameFormatConditions. 同じ書式を持つセルです。 xlCellTypeSameValidation. 同じ入力規則の条件を持つセルです。 xlCellTypeVisible. 表示されているすべてのセルです。

Value
Object

が または xlCellTypeFormulasxlCellTypeConstants場合Type、この引数を使用して、結果に含めるセルの種類を決定します。 これらの値を加算すると、複数の種類のセルを返すことができます。 既定では、すべての定数または数式が、その種類にかかわらず選択されます。 次 XlSpecialCellsValue のいずれかの値を指定できます。 xlErrorsxlLogicalxlNumbersxlTextValues

戻り値

指定した種類および値に一致するすべてのセルを表す Range を返します。

次のコード例では、 メソッドを SpecialCells 使用して、 内のコメントを含むセルの範囲を取得および選択します XmlMappedRange。 このコード例では、現在のワークシートに という名前CustomerLastNameCellの が含まれていることをXmlMappedRange前提としています。

private void SelectRangeWithComments()
{
    this.CustomerLastNameCell.AddComment("This cell contains " +
        "a last name.");

    Excel.Range range1 = this.CustomerLastNameCell.SpecialCells(
        Excel.XlCellType.xlCellTypeComments);
    range1.Select();
}
Private Sub SelectRangeWithComments()
    Me.CustomerLastNameCell.AddComment(("This cell contains " & _
        "a last name."))

    Dim range1 As Excel.Range = Me.CustomerLastNameCell.SpecialCells( _
        Excel.XlCellType.xlCellTypeComments)
    range1.Select()
End Sub

注釈

省略可能のパラメーター

省略可能なパラメーターの詳細については、「 Office ソリューションの省略可能なパラメーター」を参照してください。

適用対象