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
    Get
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 renkler iç yeşil. Sonra bir dizi sütunlar, kaç hücreleri gösteren bir ileti görüntüler ve içinde bulunduğunuz satır NamedRange.

Bu örnek, bir belge düzeyinde özelleştirme için bulunur.

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ı