ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro for Formatting (https://www.excelbanter.com/excel-programming/414630-macro-formatting.html)

Cute Techie

Macro for Formatting
 
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.
--
~We Get What We Focus On


XP

Macro for Formatting
 
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" wrote:

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.
--
~We Get What We Focus On


ML0940

Macro for Formatting
 
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" wrote:

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" wrote:

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.
--
~We Get What We Focus On


ML0940

Macro for Formatting
 
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" wrote:

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" wrote:

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.
--
~We Get What We Focus On


Cute Techie

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



"ML0940" wrote:

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" wrote:

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" wrote:

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.
--
~We Get What We Focus On



All times are GMT +1. The time now is 05:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com