I need to understand the syntax and code to determine what filters are currently applied to a spreadsheet so that I can return the filters to the sheet at the end of my macro.
I currently have a macro I created to copy and insert a row of data identical to the row your cursor is on. The first step of the macro is to unfilter the data since Excel doesn’t copy insert well with filtered data. This has confused some users because after they run the macro their data and screen looks different.
This is my current code;
I need to understand the syntax and code to determine what filters are currently applied to a spreadsheet so that I can return the filters to the sheet at the end of my macro.
I currently have a macro I created to copy and insert a row of data identical to the row your cursor is on. The first step of the macro is to unfilter the data since Excel doesn’t copy insert well with filtered data. This has confused some users because after they run the macro their data and screen looks different.
This is my current code;
Code:
Sub InsertNewRow()
' InsertNewRow Macro
' Macro recorded 1/25/2006 by Ebrandt
' Keyboard Shortcut: Ctrl+a
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
Application.EnableEvents = False
On Error Resume Next
ActiveSheet.ShowAllData
ActiveCell.EntireRow.Select
Selection.Copy
Selection.Insert Shift:=xlDown
Application.DisplayStatusBar = True
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
End Sub
I need to understand the syntax and code to determine what filters are currently applied to a spreadsheet so that I can return the filters to the sheet at the end of my macro.
Last edited by a moderator: