Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Now that we have ClearAllFilters written, let's integrate it back into the original Subroutine!
'This subroutine creates adds the filtered data from Sheet1
'to a previously-existing destination Worksheet (called "Destination" here)
Public Sub AddToDestinationWorksheet(StartDate As String, EndDate As String)
'...
'Lots of code taken out here for brevity, the first place we're going to replace
'the old clear filters logic starts on line 38 of the original
'...
'Replaced the commented-out code with our new Subroutine, you should actually
'delete the commented out lines!
Call ClearAllFilters(wksData)
'wksData.AutoFilterMode = False
'If wksData.FilterMode = True Then
' wksData.ShowAllData
'End If
Exit Sub
'...
'Lots more code taken out for brevity, the next place we're going to replace
'the old clear filters logic starts on line 78 of the original
'...
'Replaced the commented-out code with our new Subroutine, you should actually
'delete the commented out lines!
Call ClearAllFilters(wksData)
'wksData.AutoFilterMode = False
'If wksData.FilterMode = True Then
' wksData.ShowAllData
'End If
'...
'The rest of the code wraps up and then we're done!
'...
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.