Hey guys,
Have a sheet with heaps of materials indicated by a machine ID - I'm doing a simple criteria search, which hides lines not relevant then copies and pastes this info to the corresponding sheet.
Issue is for some reason... and it wasn't before it's crashing constantly. The code works fine stepping through HOWEVER you can 100% see where it locks up being .autofilter
I used to select row... by row using IF (i) select row and paste but this is too timely can anyone see the issue?
Have a sheet with heaps of materials indicated by a machine ID - I'm doing a simple criteria search, which hides lines not relevant then copies and pastes this info to the corresponding sheet.
Issue is for some reason... and it wasn't before it's crashing constantly. The code works fine stepping through HOWEVER you can 100% see where it locks up being .autofilter
I used to select row... by row using IF (i) select row and paste but this is too timely can anyone see the issue?
Code:
Sub BargeSplit()
Sheets("MasterBOM").Activate
'Replace Punching FW with nothing
Cells.Replace What:="[FW]", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Dim BargeWS As Worksheet ''DESTINATION SHEET''
On Error Resume Next
Set TB = ActiveWorkbook
Set OB = ActiveWorkbook
erow = OB.Sheets("Barge").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Row '' DESTINATION SHEET''
TB.Activate
Sheets("MasterBOM").Range("H:Y").EntireColumn.Hidden = False ''SCHEDULER SHEET''
With Sheets("MasterBOM").UsedRange
.AutoFilter
'''Barge = MACHINE ID'''
.AutoFilter field:=23, Criteria1:="Barge"
'''SEND THESE = Ability to be moved to MACHINE SHEET PAGES'''
.AutoFilter field:=25, Criteria1:="SEND THESE"
.Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).Copy OB.Sheets("Barge").Cells(erow, 1)
.AutoFilter
End With
'''REPAIR view sheet when columns are hidden/shown during selection process'''
Sheets("MasterBOM").Range("N:U").EntireColumn.Hidden = True
Sheets("MasterBOM").Range("V:Y").EntireColumn.Hidden = False
On Error GoTo 0
Call Ridge300Split
End Sub