![]() |
Data Filter Function in VBA
Is there a function or command using VBA that enables the Data Filters for a certain range....but that does not disable it if it was there in the first place. Have not been able to figure that one out. Selection.AutoFilter I have tried using the line above but the filter is removed if it was there before. Just want to ensure that the filter is always present for a range. Thanks. -- wayliff ------------------------------------------------------------------------ wayliff's Profile: http://www.excelforum.com/member.php...o&userid=29860 View this thread: http://www.excelforum.com/showthread...hreadid=500683 |
Data Filter Function in VBA
Try this
Public Function RangeFiltered(rng As Range) As Boolean Dim sh As Worksheet Set sh = rng.Parent RangeFiltered = Not Intersect(rng.EntireColumn, sh.AutoFilter.Range) Is Nothing End Function -- HTH Bob Phillips (remove nothere from email address if mailing direct) "wayliff" wrote in message ... Is there a function or command using VBA that enables the Data Filters for a certain range....but that does not disable it if it was there in the first place. Have not been able to figure that one out. Selection.AutoFilter I have tried using the line above but the filter is removed if it was there before. Just want to ensure that the filter is always present for a range. Thanks. -- wayliff ------------------------------------------------------------------------ wayliff's Profile: http://www.excelforum.com/member.php...o&userid=29860 View this thread: http://www.excelforum.com/showthread...hreadid=500683 |
All times are GMT +1. The time now is 05:08 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com