Hello!
I've created a file which has some VBA Script for Autofilter search boxes and a Reset filter function. I've tested the file with several users and have found everything works perfectly on Windows but does not work on someone using Excel - Mac. The Mac users receive a Microsoft Visual Basic 400 error. I've searched every possible thing I could think of online, but am unable to figure out why a Mac user can not use this script:
Hopefully someone can help
I've created a file which has some VBA Script for Autofilter search boxes and a Reset filter function. I've tested the file with several users and have found everything works perfectly on Windows but does not work on someone using Excel - Mac. The Mac users receive a Microsoft Visual Basic 400 error. I've searched every possible thing I could think of online, but am unable to figure out why a Mac user can not use this script:
Code:
[B]Public BaseFltr As Integer[/B]
Sub Filter()
'
Application.ScreenUpdating = False
Range("A19").Select
ActiveWindow.FreezePanes = True
Rows("18:18").Select
' Range("C18").Activate
Selection.EntireRow.Hidden = True
With Sheet1
.AutoFilterMode = False
With .Range("$E$18:$AJ$111111")
.AutoFilter
If Range("B6").Value <> "" Then .AutoFilter Field:=1, Criteria1:="=*" & Range("B6").Value & "*"
If Range("B7").Value <> "" Then .AutoFilter Field:=2, Criteria1:="=*" & Range("B7").Value & "*"
End With
End With
End Sub
[B]Sub AddtnlFilters()[/B]
'
Application.ScreenUpdating = False
Range("A19").Select
ActiveWindow.FreezePanes = True
Rows("18:18").Select
' Range("C18").Activate
Selection.EntireRow.Hidden = True
With Sheet1
.AutoFilterMode = False
With .Range("$A$18:$AJ$111111")
.AutoFilter
If Range("B6").Value <> "" Then .AutoFilter Field:=5, Criteria1:="=*" & Range("B6").Value & "*"
If Range("B7").Value <> "" Then .AutoFilter Field:=6, Criteria1:="=*" & Range("B7").Value & "*"
If Range("B11").Value <> "" Then .AutoFilter Field:=3, Criteria1:="=*" & Range("B11").Value & "*"
If Range("B12").Value <> "" Then .AutoFilter Field:=4, Criteria1:="=*" & Range("B12").Value & "*"
If Range("B13").Value <> "" Then .AutoFilter Field:=13, Criteria1:="=*" & Range("B13").Value & "*"
If Range("B14").Value <> "" Then .AutoFilter Field:=17, Criteria1:="=*" & Range("B14").Value & "*"
If Range("B15").Value <> "" Then .AutoFilter Field:=18, Criteria1:="=*" & Range("B15").Value & "*"
If Range("D11").Value <> "" Then .AutoFilter Field:=21, Criteria1:="=*" & Range("D11").Value & "*"
If Range("D12").Value <> "" Then .AutoFilter Field:=22, Criteria1:="=" & Range("D12").Value & ""
If Range("D13").Value <> "" Then .AutoFilter Field:=16, Criteria1:="=*" & Range("D13").Value & "*"
If Range("D14").Value <> "" Then .AutoFilter Field:=30, Criteria1:="=*" & Range("D14").Value & "*"
If Range("D15").Value <> "" Then .AutoFilter Field:=36, Criteria1:="=*" & Range("D15").Value & "*"
End With
End With
'End If
End Sub
[B]Sub ResetFilters()[/B]
'
Application.ScreenUpdating = False
Range("A19").Select
ActiveWindow.FreezePanes = True
Rows("18:18").Select
' Range("C18").Activate
Selection.EntireRow.Hidden = True
Range("B6:B7").ClearContents
Range("B11:B15").ClearContents
Range("D11:D15").ClearContents
Range("B6").Select
With Sheet1
.AutoFilterMode = False
End With
End Sub
Last edited by a moderator: