I am using VBA to filter some data and I want to get a total for the filtered data.
I have used:
However, this returns the sum of all the values not the filtered ones.
Anyone got any ideas on how to sum up the filtered values?
I have had a look at subtotal, but I am unable to get the correct figure. I could copy & paste the filtered data to a new sheet, but there are a lot of these to do and it may take to long do it this way.
ITLee. MCP\Dev\Prog\DBA\ITIL
I have used:
Code:
[COLOR=green]'AutoFilter code here...[/color]
Set myRange = ActiveWorksheet.Range("D:D")
dblTotal = App.WorksheetFunction.Sum(myRange)
However, this returns the sum of all the values not the filtered ones.
Anyone got any ideas on how to sum up the filtered values?
I have had a look at subtotal, but I am unable to get the correct figure. I could copy & paste the filtered data to a new sheet, but there are a lot of these to do and it may take to long do it this way.
ITLee. MCP\Dev\Prog\DBA\ITIL