Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a budget table that has a Allocated budget amount, Expenses and a
remaining balance: Allocated Expenses Remaining Budget Subtotal Balance ----------------------------------------- $500.00 $300.00 $200.00 The Expense Subtotal is a sum of column of values below this header say H30:H100. The Subtotal is of the rows that are visible so say there are two values, $100.00 and $200.00 and $100.00 is hidden by an autofilter. Then Subtotal will become $200.00. If an auto filter is active I want to blank the Remaining Balance field. I have a function that will return a string 'true' if an autofilter is active: Function MyFilters() As String Dim i As Integer Dim rng As Range 'Debug.Print "- MyFilters: " & Err.Number On Error GoTo ErrThisFun MyFilters = False With ActiveSheet.AutoFilter 'Debug.Print "-- MyFilters: Auto:" & .Range.Address For i = 1 To .Range.Columns.Count With .Filters(i) If .On Then MyFilters = True End If End With Next End With GoTo ExitFun ErrThisFun: 'Debug.Print "-- MyFilters: ERR: " & Err.Number Resume ExitFun ExitFun: 'Debug.Print "<- MyFilters: " & Err.Number End Function Of course, this function could return a boolean. How can I use this function to blank the Remaining Balance cells? I tried making it a UDF and adding Application.Volatile and Public, but that causes another unrelated macro that modifies other cells to fail with RunTime Error 1004. Anything that runs the MyFilters causes the other macros to fail. Any ideas? John S. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy data when Autofilter On and active | Excel Programming | |||
Autofilter on non-active sheet | Excel Programming | |||
Ignore Blank Cells on AutoFilter | Excel Programming | |||
Autofilter a list of numbers and blank cells | Excel Discussion (Misc queries) | |||
autofilter on a not-active sheet | Excel Programming |