I try to run the following code, where I find the proper column in a sheet to format it.
Then I use Autofilter to set a filter criteria on the same sheet (but different value).
the following error appears: Autofilter Method of range class failed
If I use the very same code, but format the two colomns in the beginning using fixed range
it works fine.
Please help
Then I use Autofilter to set a filter criteria on the same sheet (but different value).
the following error appears: Autofilter Method of range class failed
If I use the very same code, but format the two colomns in the beginning using fixed range
Code:
'Range("C:C").NumberFormat = "General"
'Range("E:E").NumberFormat = "General"
it works fine.
Please help
Code:
Dim Row as Variant
Dim FilterRow as Variant
Row = Rows("1:1").Find(What:="Erstellt", LookAt:=xlWhole).Column
Range(Cells(1, Row), Cells(100000, Row)).NumberFormat = "General"
Row = Rows("1:1").Find(What:="bestätigt", LookAt:=xlWhole).Column
Range(Cells(1, Row), Cells(100000, Row)).NumberFormat = "General"
If WrkShtRSTand.AutoFilterMode Then
WrkShtRSTand.ShowAllData
Else
WrkShtRSTand.Range("A1").AutoFilter
End If
FilterRow = Rows("1:1").Find(What:="Einkäufergruppe", LookAt:=xlWhole).Column
WrkShtRSTand.UsedRange.AutoFilter Field:=FilterRow, Criteria1:=Array("AZ04", "AZ05", "AZ07", "AZ08"), Operator:=xlFilterValues