Option Explicit
Sub Format_Sheet()
Dim lrow As Long, lcol As Long, c As Range
Application.ScreenUpdating = False
Rows("1:2").Delete
lrow = Cells(Rows.Count, 1).End(xlUp).Row - 1
Range("A" & lrow, Range("A" & lrow + 1)).EntireRow.Delete
On Error Resume Next
For Each c In Range("F1:G" & lrow)
If c.Value = "-" Or c.Value <= 0 Then
c.EntireRow.Delete
End If
Next c
lcol = Cells(1, Columns.Count).End(xlToLeft).Column
Columns(lcol).EntireColumn.Delete
Range(Cells(1, 1), Cells(1, lcol)).Columns.AutoFit
Application.ScreenUpdating = True
End Sub
EDIT: overlook the comment to delete a column. Code is now amended for this requirement, as well as including code to autofit the columns per the contents of cells in row 1. Attached new copy of the workbook with revised code.
Bookmarks