Hi Mak2145
As I previously suggested
you could probably use AutoFilter for the first part of the routine rather than a loop and VLookUps
This code does that and eliminates the lookups. It's been tested in Excel 2007 and Excel 2000 and appears to do as you require.
Sub SubOpsListing()
Dim LR As Long
Dim rng1 As Range
Dim rng2 As Range
Dim myRng As Range
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Sheets("Standard Output").Select
Range("A1:B10000").ClearContents
With Sheet6
LR = .Cells.Find("*", .Cells(Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
.Range("A3:C" & LR).AutoFilter Field:=2, Criteria1:="YES"
Set rng1 = .Range("A4:A" & LR).SpecialCells(xlCellTypeVisible)
Set rng2 = .Range("C4:C" & LR).SpecialCells(xlCellTypeVisible)
Set myRng = Union(rng1, rng2)
myRng.Copy
Sheet2.Range("A2").PasteSpecial xlPasteValues
.AutoFilterMode = False
End With
Range("A1:B10000").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A1").Select
Application.CutCopyMode = False
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Bookmarks