To set command for total amount

  • Thread starter Thread starter Jentan
  • Start date Start date
J

Jentan

Hi,

I wish to set a "total" to the Sales column. Then bold the "total"
amount. May I know the command? Please bear in mind that the row is
not fixed for the total amount cell and it depends on the items being
sold. Thank you.


Item Sales
A 10
B 11
C 12
 
From the Data menu
Select Subtotals and follow the prompts.

This will generate a subtotal and a grand total in bold letters for you
automatically without the need of any coding

Michael Arch.
 
Michael's right, but if you must:


Sub test()

Set iEnd = Cells(Rows.Count, 2).End(xlUp)

With iEnd.Offset(1, 0)
.Formula = "=SUM($B$2:" & iEnd.Address & ")"
.Font.Bold = True
End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top