Aracılığıyla paylaş


WorksheetBase.Index Özellik

Çalışma topluluğu içinde çalışma sayfası dizin numarasını alır.

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

Sözdizimi

'Bildirim
Public ReadOnly Property Index As Integer
    Get
public int Index { get; }

Özellik Değeri

Tür: System.Int32
Çalışma çalışma sayfalarının koleksiyonu içindeki dizin sayısı.

Örnekler

Aşağıdaki kod örneği Index önce ve sonra çalışma son taşıma geçerli çalışma sayfasının dizin numarasını görüntülemek için özellik kullanarak çalışma kitabındaki getirin Move yöntemi.

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

Private Sub DisplayIndex()
    MsgBox("Before moving, this worksheet is at tab number " & _
        Me.Index.ToString())

    ' Move the worksheet to the last position in the workbook.
    Me.Move(After:=Globals.ThisWorkbook.Worksheets( _
        Globals.ThisWorkbook.Worksheets.Count))

    MsgBox("After moving, this worksheet is at tab number " & _
        Me.Index.ToString())
End Sub
private void DisplayIndex()
{
    MessageBox.Show("Before moving, this worksheet is at tab number " +
        this.Index.ToString());

    // Move the worksheet to the last position in the workbook.
    this.Move(missing, 
        Globals.ThisWorkbook.Worksheets[Globals.ThisWorkbook.Worksheets.Count]);

    MessageBox.Show("After moving, this worksheet is at tab number " +
        this.Index.ToString());
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

WorksheetBase Sınıf

Microsoft.Office.Tools.Excel Ad Alanı