I have the code below, which works to filter exactly how I need it to except that I would like to be able to include any blank rows at the top of filtered that are within the Range "Table" so I am able to create a filter and then add more items that would be included in that same filter. Those new items would be blank rows of data at first but they would be filled in right after creating a new row/record. Is there any way to modify this so blank rows would just stay at the top and still be visible whenever a filter is applied? Something like ActiveSheet.ShowBlankRows....
Sub Insert_Row()
'
' Insert_Row
'
'
Application.ScreenUpdating = False
ActiveSheet.Unprotect
If ActiveSheet.AutoFilterMode Then
If ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If
ElseIf ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If
Rows("5:7").Select
Selection.EntireRow.Hidden = False
Rows("8:10").Select
Selection.EntireRow.Hidden = False
Range("A6:AH6").Select
Selection.Copy
Range("A10:AH10").Select
Selection.Insert Shift:=xlDown
Rows("6:6").Select
Selection.EntireRow.Hidden = True
Rows("9:9").Select
Selection.EntireRow.Hidden = True
Range("Table").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Range("B4:AH5"), Unique:=False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
Range("B10").Select
Application.ScreenUpdating = True
End Sub
Thanks for your help!
Bookmarks