id="info"

Question

Locked

Formatting VBA Code or Macro in Excel

By Dayle1011 ·
I am creating a spreadsheet where I have subtotals. However, I want to add subtotal underscore lines to establish an "accounting" formatting. Does anyone know how to create a MACRO or VBA code to accomplish this?

Thank you :)

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

I assume this is for automation?

by Tink! In reply to Formatting VBA Code or Ma ...

Because otherwise you wouldn't need a Macro.

Do you just want a single line under the subtotal? If so, it's usually easiest to use the thin line border on the bottom of the cell containing the subtotal. Located in Format, Cells, click the Border tab. If you have the Formatting Toolbar visible, there is a Cell Border button that usually defaults to the bottom line, but you can also click it and select which pre-selected border you want.

If you still need a macro please let us know.

Collapse -

Macro

by Dayle1011 In reply to I assume this is for auto ...

Hi Tink,
Thank you for your reply. Yes this is for automation, however, I need the double underline and the single line to format the subtotals. Now the problem is that there are multiple line items since the subtotal feature has been used. Will a macro just run on the line items listed?

Collapse -

still need a macro?

by Tink! In reply to Macro

Ok. I'm still questioning the need for a macro. Maybe a few more details would help clarify things.

Is this sheet going to always change in length?

Or is the number of lines/entries always going to be the same - so the subtotal line stays in the same cell always?

If the Subtotal feature is creating extra lines - perhaps it's best not to use it, but instead setup your own Sum formulas to include the line items you want. Does this sound better? I can help you further if you need it.

Back to Software Forum
4 total posts (Page 1 of 1)  

Software Forums