Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have tried to add the below VBA-code from
http://www.ozgrid.com/VBA/autofilter-criteria.htm in a new module, but it continues to return #NAME? when I try to use the function: Function AutoFilter_Criteria(Header As Range) As String Dim strCri1 As String, strCri2 As String Application.Volatile With Header.Parent.AutoFilter With .Filters(Header.Column - .Range.Column + 1) If Not .On Then Exit Function strCri1 = .Criteria1 If .Operator = xlAnd Then strCri2 = " AND " & .Criteria2 ElseIf .Operator = xlOr Then strCri2 = " OR " & .Criteria2 End If End With End With AutoFilter_Criteria = UCase(Header) & ": " & strCri1 & strCri2 End Function Does this indicate an error in the VBA syntax or perhaps that the module is not made available? Mogens |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF function returns function statement rather than result | Excel Worksheet Functions | |||
If function returns #REF!, want it to return 0 | Excel Worksheet Functions | |||
INT Function Returns 1 | Excel Worksheet Functions | |||
Date function returns #NUM! | Excel Worksheet Functions | |||
Function returns a zero value | Excel Programming |