this is my current Macro but it takes a while to process part of the data.... I only have 2000 rows for testing.
Is there a faster way? I normally use
but it doesn't seem to work when filtering the data...
Is there a faster way? I normally use
VBA Code:
.Range("").value =.Range("").value
VBA Code:
Sub SortData()
Dim WsSource As Worksheet
Dim WsDest As Worksheet
Dim LastRow As Long
Set WsSource = Sheets("Usage Import")
Set WsDest = Sheets("Sheet1")
LastRow = WsSource.Range("A" & WsSource.Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
With WsSource
.Range("A1:E1").AutoFilter
.Range("$A$1:$E" & LastRow).AutoFilter Field:=1, Criteria1:="Time Of Use"
.Range("B:C").SpecialCells(xlCellTypeVisible).Copy
WsDest.Range("A:B").PasteSpecial
.Range("E:E").SpecialCells(xlCellTypeVisible).Copy
WsDest.Range("C:C").PasteSpecial
WsDest.Range("C1").Value = "TOU"
' More of the same formulas here just different filtering
End With
Application.ScreenUpdating = True
End Sub
Last edited: