Macro for Formatting

  • Thread starter Thread starter Cute Techie
  • Start date Start date
C

Cute Techie

Hello all,
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?

Thanks for your time.
 
Hi Cute,

One way:

Go to [Tools] then [Macro] then [Record New Macro].

Underline your cells. Then turn off the recorder.

For more help on this go to help and enter "Record a Macro"

Hope this helps you.
 
Hi Cute,

I have one that does just that, it is

'Change cell format in Range back to accounting
Range("B" & i).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($*
""-""??_);_(@_)"

Just replace this ("B" & i) with your range.

Also, for things such as this, if you turn on the macro recorder and format
manually, the recorder will recoord the code that you need; then you can copy
and paaste it to your module/macro.
Who would ever remember this mess :)

Hope it helps!

ML

XP said:
Hi Cute,

One way:

Go to [Tools] then [Macro] then [Record New Macro].

Underline your cells. Then turn off the recorder.

For more help on this go to help and enter "Record a Macro"

Hope this helps you.

Cute Techie said:
Hello all,
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?

Thanks for your time.
 
Ahh,\I pologize, XP did mention the recorder and yes, that is the annswer for
futre formatiing needs, however, I did give you the code for accounting format

ML

XP said:
Hi Cute,

One way:

Go to [Tools] then [Macro] then [Record New Macro].

Underline your cells. Then turn off the recorder.

For more help on this go to help and enter "Record a Macro"

Hope this helps you.

Cute Techie said:
Hello all,
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?

Thanks for your time.
 
Thank you and I'll try it on Monday :) Will this do this for non-contigous
rows?
--
~We Get What We Focus On



ML0940 said:
Hi Cute,

I have one that does just that, it is

'Change cell format in Range back to accounting
Range("B" & i).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($*
""-""??_);_(@_)"

Just replace this ("B" & i) with your range.

Also, for things such as this, if you turn on the macro recorder and format
manually, the recorder will recoord the code that you need; then you can copy
and paaste it to your module/macro.
Who would ever remember this mess :)

Hope it helps!

ML

XP said:
Hi Cute,

One way:

Go to [Tools] then [Macro] then [Record New Macro].

Underline your cells. Then turn off the recorder.

For more help on this go to help and enter "Record a Macro"

Hope this helps you.

Cute Techie said:
Hello all,
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?

Thanks for your time.
 

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