Sub MoveCells()
Application.ScreenUpdating = False
Dim LastRow As Long, fnd As Range, unit As Range, I As Range, lCol As Long, x As Long
Set fnd = Range("B:B").Find("Generated by", LookIn:=xlValues, lookat:=xlPart)
x = fnd.Row
Set unit = Range("B:B").Find("Unit", SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
Range("A" & fnd.Row & ":A" & unit.Row).EntireRow.Delete
LastRow = Range("C" & Rows.Count).End(xlUp).Row
lCol = ActiveSheet.Cells(x, Columns.Count).End(xlToLeft).Column
Set I = Rows(x).Find("I")
If Not I Is Nothing Then
Range(Cells(x, I.Column), Cells(LastRow, lCol)).Cut Cells(x, I.Column - 1)
End If
Application.ScreenUpdating = True
End Sub
Bookmarks