Code:
Option Explicit
Sub TrimAllSheets()
Dim cs As String
cs = ActiveSheet.Name
Dim y As Integer
y = Application.InputBox("How many bottom rows do you wish to delete?", _
Default:=3, Type:=1) 'Change default number (3) if desired.
If MsgBox("Are you sure you wish to delete " & y & " rows from the bottom of ALL sheets?", _
vbYesNo, "Trim ALL Sheets") = vbNo Then Exit Sub
Application.ScreenUpdating = False
Dim r As Range, s As Range
Dim ws As Worksheet
On Error Resume Next 'Error handler
For Each ws In ThisWorkbook.Worksheets
ws.Activate
Set r = ActiveSheet.Range("A65536").End(xlUp).Offset(-y + 1)
Set s = ActiveSheet.Range("A65536").End(xlUp)
If ActiveCell.Row < 10 Then Goto circumv 'Not to delete Headers
Range(r, s).EntireRow.Delete
circumv:
Next ws
Sheets(cs).Activate
Application.ScreenUpdating = True
End Sub
Bookmarks