' clean up the Deposit Amount column
Columns("E:E").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("E1").Select
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("E2").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-1],33,100)"
Range("E2").Select
On Error Resume Next
Selection.AutoFill Destination:=Range("E2:E" & LastRow)
Range("E2:E" & LastRow).Select
Columns("E:E").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Columns("D:D").Select
Selection.Delete Shift:=xlToLeft
' sort by carrier name, then by 835 received date date
Columns("A:J").Select
ActiveWorkbook.Worksheets("3 Open Payment Batch Zero").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("3 Open Payment Batch Zero").Sort.SortFields.Add Key:= _
Range("A2:A" & LastRow), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
:=xlSortNormal
ActiveWorkbook.Worksheets("3 Open Payment Batch Zero").Sort.SortFields.Add Key:= _
Range("B2:B" & LastRow), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
:=xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("2 Open Payment Batch").Sort
.SetRange Range("A1:J" & LastRow)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Columns("A:H").EntireColumn.AutoFit
End If
Range("A1").Select
Sheets("1 Unposted Detail Batch Match").Select
Application.DisplayAlerts = True