Macro to Count and Sum

I have created a macro to process a workbook from text file. I need to add to the macro a COUNT and SUM for certain columns. The numbers of row will vary based on amount of data. Thus I cannot use explicit row ranges. I have tried some of this, but the data counts and sum for the wrong column.

Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Select
Range("A1").Select
ActiveCell.FormulaR1C1 = "ACCT NO TOTAL"
Range("B1").Select
ActiveCell.FormulaR1C1 = "=COUNT(OBJBNC!B1)"
Range("A2").Select
ActiveCell.FormulaR1C1 = "ACCT BAL TOTAL"
Range("B2").Select
ActiveCell.FormulaR1C1 = "=SUM(OBJBNC!G1)"
Range("A3").Select
ActiveCell.FormulaR1C1 = "PAT BAL TOTAL"
Range("B3").Select
ActiveCell.FormulaR1C1 = "=SUM(OBJBNC!H1)"

I just need the macro to display the COUNT or SUM at the end of the column. Something like the SUBTOTAL Function.


Thanks in advance.