Help! I am trying to find a VBA solution to allow users to delete one or more rows at the bottom of an excel table (preferrably one row at a time); i.e. users may have inadvertently added new rows that they now want to delete before finalizing the report. The worksheet is protected.
Below is the VBA I am using (a VBA newbie) to allow users to add a new row.
Sub AddRows()
Dim oListCol As ListRow
Dim x As Integer, i As Integer
'check if any lists on this sheet
x = ActiveSheet.ListObjects.Count
If x > 0 Then
For i = 1 To x
'Add new row to list
Set oListCol = ActiveSheet.ListObjects(i).ListRows.Add
Next i
End If
End Sub
Any help or suggestions are appreciated.
Thanks!
-Alisser
Below is the VBA I am using (a VBA newbie) to allow users to add a new row.
Sub AddRows()
Dim oListCol As ListRow
Dim x As Integer, i As Integer
'check if any lists on this sheet
x = ActiveSheet.ListObjects.Count
If x > 0 Then
For i = 1 To x
'Add new row to list
Set oListCol = ActiveSheet.ListObjects(i).ListRows.Add
Next i
End If
End Sub
Any help or suggestions are appreciated.
Thanks!
-Alisser