I have a problem, when trying to make an autofilter in vba it is trying to filter the values I chose but it does not filter 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 as follows the name of the file in case it is 1102 and in the filter column it had the following formula =left(c7;4)
that returned several values being some of them 1102 so I thought the problem was the formula valorizei and I tried the code above using text, then I tried using numbers and did not get results, what is wrong? Why do not I still filter anything?