R
ryguy7272
I'm trying to use the macro below to disable the List feature which is
applied to some worksheets and it is really turning out to be a PITA.
Anyway, I recorded two small macros and got this code:
Range("A3").Select
ActiveSheet.ListObjects("Table1").Unlist
Range("M3").Select
ActiveSheet.ListObjects("List2").Unlist
I tried to modify this in my code below. The macro below will loop through
all sheets, no problems there. However, it will NOT disable that stubborn
List feature in each sheet...whcih in some sheets seems to be a table
("Table1") and in other sheets seems to be a specific list ("List2")
Sub Macro1()
For Each sh In ThisWorkbook.Worksheets
If ActiveSheet.AutoFilterMode = True Then
Rows("1:1").Select
Selection.AutoFilter
If ActiveSheet.AutoFilterMode = False Then
If ActiveSheet.ListObjects = True Then
ActiveSheet.ListObjects.Unlist
If ActiveSheet.ListObjects = False Then
End If
End If
End If
End If
Next
End Sub
I'd appreciate any and all help.
Regards,
Ryan---
applied to some worksheets and it is really turning out to be a PITA.
Anyway, I recorded two small macros and got this code:
Range("A3").Select
ActiveSheet.ListObjects("Table1").Unlist
Range("M3").Select
ActiveSheet.ListObjects("List2").Unlist
I tried to modify this in my code below. The macro below will loop through
all sheets, no problems there. However, it will NOT disable that stubborn
List feature in each sheet...whcih in some sheets seems to be a table
("Table1") and in other sheets seems to be a specific list ("List2")
Sub Macro1()
For Each sh In ThisWorkbook.Worksheets
If ActiveSheet.AutoFilterMode = True Then
Rows("1:1").Select
Selection.AutoFilter
If ActiveSheet.AutoFilterMode = False Then
If ActiveSheet.ListObjects = True Then
ActiveSheet.ListObjects.Unlist
If ActiveSheet.ListObjects = False Then
End If
End If
End If
End If
Next
End Sub
I'd appreciate any and all help.
Regards,
Ryan---