ListObject.InsertRowRange Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient un Range qui représente la ligne d'insertion, le cas échéant, du contrôle ListObject.
public Microsoft.Office.Interop.Excel.Range InsertRowRange { get; }
Valeur de propriété
Range qui représente la ligne d'insertion, le cas échéant, du contrôle ListObject.
Exemples
L’exemple de code suivant crée un ListObject , obtient la plage qui contient la ligne d’insertion, puis affiche un message indiquant le nombre de cellules contenues dans la ligne d’insertion.
Cet exemple est destiné à une personnalisation au niveau du document.
private void ListObject_InsertRowRange()
{
Microsoft.Office.Tools.Excel.ListObject list1 =
this.Controls.AddListObject(
this.Range["A1", "C4"], "list1");
Excel.Range insertRow = list1.InsertRowRange;
MessageBox.Show("The insert row contains " +
insertRow.Cells.Count.ToString() +
" cells.");
}
Private Sub ListObject_InsertRowRange()
Dim List1 As Microsoft.Office.Tools.Excel.ListObject = _
Me.Controls.AddListObject(Me.Range("A1", "C4"), "List1")
Dim insertRow As Excel.Range = List1.InsertRowRange
MessageBox.Show("The insert row contains " & _
insertRow.Cells.Count.ToString() & " cells.")
End Sub
Remarques
S’il n’y a pas de ligne d’insertion, InsertRowRange retourne null .