Aracılığıyla paylaş


NamedRange.Cells Özellik

Alır bir Microsoft.Office.Interop.Excel.Range hücreleri temsil eden NamedRange denetim.

Ad alanı:  Microsoft.Office.Tools.Excel
Derleme:  Microsoft.Office.Tools.Excel (Microsoft.Office.Tools.Excel.dll içinde)

Sözdizimi

'Bildirim
ReadOnly Property Cells As Range
Range Cells { get; }

Özellik Değeri

Tür: Microsoft.Office.Interop.Excel.Range
A Microsoft.Office.Interop.Excel.Range hücreleri temsil eden NamedRange denetim.

Örnekler

Aşağıdaki kod örneği oluşturur bir NamedRange ve iç yeşil renkler.Daha sonra bir dizi kaç, sütunlar, hücreler gösteren bir ileti görüntüler ve satır bulunan NamedRange.

Bu örnek için belge düzeyi özelleştirmesinde içindir.

Private compositeRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub DisplayRangeComposition()
    compositeRange = Me.Controls.AddNamedRange( _
        Me.Range("B2", "E5"), "compositeRange")
    compositeRange.Cells.Interior.Color = &HFF00
    MessageBox.Show("The range has " & _
        compositeRange.Count & " cells.")
    MessageBox.Show("The range has " & _
        compositeRange.Columns.Count & " columns.")
    MessageBox.Show("The range has " & _
        compositeRange.Rows.Count & " rows.")
End Sub
Microsoft.Office.Tools.Excel.NamedRange compositeRange;
private void DisplayRangeComposition()
{
    compositeRange = this.Controls.AddNamedRange(
        this.Range["B2", "E5"], "compositeRange");
    compositeRange.Cells.Interior.Color = 0xFF00;
    MessageBox.Show("The range has " + compositeRange.Count + 
        " cells.");
    MessageBox.Show("The range has " + 
        compositeRange.Columns.Count + " columns.");
    MessageBox.Show("The range has " + 
        compositeRange.Rows.Count + " rows.");
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

NamedRange Arabirim

Microsoft.Office.Tools.Excel Ad Alanı