0
I have a problem, when trying to make an autofilter in vba it is trying to filter the values I chose but ends up not filtering value, I searched a lot and found no explanation. The code is as follows::
Dim nomeArquivo As String
Dim gd As Integer
nomeArquivo = Left(ThisWorkbook.Name, (InStrRev(ThisWorkbook.Name, ".", -1, vbTextCompare) - 1))
gd = CInt(nomeArquivo)
ActiveSheet.Range("$A$6:$C$989088").AutoFilter Field:=3, Criteria1:="<>" & gd
The conditions are the following the file name in case is 1102 and in the filter column had the following formula =left(c7;4)
that returned several values being some of them 1102 so I thought the problem was the formula valorized and tried the above code using text, then tried using numbers and got no result, what is wrong ? why I keep not filtering anything?
Are the values exactly equal to 1102? Or only contains this value? And could add some different values from column C? with the expected result?
– danieltakeshi