Incase this helps the following code has been used:
I've gotten a bit further but basically the same error is coming up or only part of the Macro works?
Sub Convert_Test()
Dim rdata As Range
Dim filt As Range
Dim dest As Range
Dim uniquework As Range
Dim cwork As Range
Dim rwork As Range
Dim work As String
Clear_Filtered
Worksheets("Data_Master").Activate
Set rwork = Range(Range("E1"), Range("E1").End(xlDown))
Set uniquework = Range("A1").End(xlDown).Offset(5, 0)
Set rdata = Range("A1").CurrentRegion
rwork.AdvancedFilter xlFilterCopy, , uniquework, True
Set uniquework = Range(uniquework.Offset(1, 0), uniquework.End(xlDown))
For Each cwork In uniquework
work = cwork.Value
rdata.AutoFilter field:=5, Criteria1:=work
Set filt = rdata.SpecialCells(xlCellTypeVisible)
filt.Copy Worksheets("Filtered").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
ActiveSheet.AutoFilterMode = False
Next cwork
With Worksheets("Filtered")
.Range("a1").EntireColumn.Delete
.Range("A1:B1").EntireColumn.Cut .Range("E1")
.Range("A1:C1").EntireColumn.Delete
End With
Range(Range("a1").End(xlDown).Offset(1, 0), Cells(Rows.Count, "A")).EntireRow.Delete
End Sub
The inparticular part of code that appears to fail and shoot up the out of range error is
rdata.AutoFilter field:=5, Criteria1:=work
Bookmarks