close

I am having a problem with the following code. It seems to stop at the second
from last lt;End ifgt; and I don't know why?

TFTH,
Tom

Sub Archive()
Dim iLastRow1 As Long
Dim aLastRow As Long
Dim i As Integer
Dim j As Integer
Dim rw As Long, iCol As Integer

'Determine last row in each activity sheet with a quot;time backquot;

iLastRow1 = Sheets(quot;Order Pickquot;).Cells(Rows.Count, quot;AUquot;).End(xlUp).Row
aLastRow = Sheets(quot;Daily Archivequot;).Cells(Rows.Count, quot;Aquot;).End(xlUp).Row 1

Application.ScreenUpdating = False

'////////// ORDER PICK ////////////
' Cut and paste each row with a quot;time backquot; into the load truck file

For i = iLastRow1 To 24 Step -1
With Sheets(quot;Order Pickquot;).Cells(i, quot;AUquot;)
If .Value lt;gt; quot;quot; Then
.EntireRow.Cut Sheets(quot;Daily Archivequot;).Cells(aLastRow, quot;Aquot;)
End If
End With
aLastRow = aLastRow 1
Next i

' Erase empty rows from each activity sheetFor rw = Sheets(quot;Order Pickquot;).UsedRange.Rows.Count To 24 Step -1
If IsEmpty(Cells(rw, 1)) Then
If Cells(rw, Columns.Count).End(xlToLeft).Column = 1 Then
Rows(rw).Delete
End If
End If
Next

' Erase empty rows from daily archive sheet

Sheets(quot;Daily Archivequot;).Select
Columns(quot;A:Aquot;).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete

Application.ScreenUpdating = True

End Sub

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()