dont have Excel at the moment .....but consider using auto filter to get the visible cells in the downpipe sheet then copy across in one block..
This is UNTESTED
Code:
Sub ImportBlueDownpipe()
Dim DownpipeWS As Worksheet, DownpipeMachineWS As Worksheet
Set DownpipeWS = Sheets("Downpipe")
With ActiveSheet
.AutoFilterMode = False
.UsedRange.AutoFilter
.UsedRange.AutoFilter field:=8, Criteria1:="MB"
.UsedRange.AutoFilter field:=23, Criteria1:="Downpipe"
.SpecialCells(xlCellTypeVisible).Copy
.AutoFilter
End With
Workbooks.Open Filename:="B:\Best Shed Scheduler.xlsm" '''''Found on local machine drive'''''nothing networked''''
Set DownpipeMachineWS = Sheets("Downpipe Machine")
erow = DownpipeMachineWS.Cells(DownpipeMachineWS.Rows.Count, 1).End(xlUp).Offset(1, 0).Row
DownpipeMachineWS.Cells(erow, 1).Paste
ActiveWorkbook.Save
ActiveWorkbook.Close
Application.CutCopyMode = False
End If
End Sub
Like this thread? Share it with others