Excel vba will not recognise that AutoFilter is enabled. However, it works on the initial sheet which the code is run from.
Using code:
If ActiveSheet.AutoFilterMode Then
Option 1
Else
Option 2
End If
I have tried to use vba prior to the above code, to remove and re-add the autofilter on the sheet, but that made no difference (I used "ActiveSheet.Range("Table_Data[#Headers]").AutoFilter").
I have also tried using "If ActiveSheet.AutoFilterMode = True Then" & "If ActiveSheet.AutoFilterMode = False Then" and the code definitely thinks that the filters are not applied.
Has anyone had this issue and knows how to fix it?
Using code:
If ActiveSheet.AutoFilterMode Then
Option 1
Else
Option 2
End If
I have tried to use vba prior to the above code, to remove and re-add the autofilter on the sheet, but that made no difference (I used "ActiveSheet.Range("Table_Data[#Headers]").AutoFilter").
I have also tried using "If ActiveSheet.AutoFilterMode = True Then" & "If ActiveSheet.AutoFilterMode = False Then" and the code definitely thinks that the filters are not applied.
Has anyone had this issue and knows how to fix it?