Hello:
I have an excel macro that loads in html table data with inventory quantities, cost, profit, Invoice numbers and product descriptions.
Once the data is imported I need to add sum totals to the bottom of several columns (i.e. total profit, total cost, etc) excluding the headers from each calculation.
Once the totals are calculated the macro then saves the data with column totals to a new spreadsheet with the current date.
The number of rows vary since the number of items may change each time this report is run.
How can this be done (creating summary cells at the end of selected columns) with an Excel Macro?
I tried using:
With ActiveCell
Set rng = Range(.Offset(1), .Offset(1).End(xlDown))
.Formula = "=SUM(" & rng.Address & ")"
End With
but it places (for example)
"=SUM($K$3:$K$33)" into the active cell, instead of =Sum(k3:k33)
For this reason the result always = "0" in the cell where I would like the total to appear.
Please advise, help needed.
Thanks in advance,
Rich
I have an excel macro that loads in html table data with inventory quantities, cost, profit, Invoice numbers and product descriptions.
Once the data is imported I need to add sum totals to the bottom of several columns (i.e. total profit, total cost, etc) excluding the headers from each calculation.
Once the totals are calculated the macro then saves the data with column totals to a new spreadsheet with the current date.
The number of rows vary since the number of items may change each time this report is run.
How can this be done (creating summary cells at the end of selected columns) with an Excel Macro?
I tried using:
With ActiveCell
Set rng = Range(.Offset(1), .Offset(1).End(xlDown))
.Formula = "=SUM(" & rng.Address & ")"
End With
but it places (for example)
"=SUM($K$3:$K$33)" into the active cell, instead of =Sum(k3:k33)
For this reason the result always = "0" in the cell where I would like the total to appear.
Please advise, help needed.
Thanks in advance,
Rich