I have a macro setup that filters the amounts column E to only show rows with information and copies the filterd data from Spreadsheet 1 and creates a new spreadsheet as paste the data. There are 1000k rows in spreadsheet 1 but the number of rows that will be filtered will vary... could be 1 could be 60. I would like to sum the total in column E and count the number of rows that have information. I can get the sum, but having trouble doing both. I have searched the web looking for similar topics and found one that will help me total Column E, but I cannot figure out how to count the rows. In addition, If I could add Total to the preceding cell in column E, that would be very helpful.
Thanks in advance for any suggestions!
Thanks in advance for any suggestions!
VBA Code:
Sub With_Funds()
'
' With_Funds Macro
'
'
Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$S$1220").AutoFilter Field:=5, Criteria1:=">=.01", _
Operator:=xlAnd
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.Columns.AutoFit
Columns("E:E").Select
Application.CutCopyMode = False
Selection.NumberFormat = "$#,##0.00"
Dim Rng As Range
Dim c As Range
Set Rng = Range("E1:E" & Range("E1").End(xlDown).Row)
Set c = Range("E1").End(xlDown).Offset(1, 0)
c.Formula = "=SUM(" & Rng.Address(False, False) & ")"
End Sub