Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default New button on toolbar

Can i create a new toolbar button which will format a cell in a particular
style?

I am trying to create a style similar to "Comma style" but without any
decimal places.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 91
Default New button on toolbar

attaboy wrote:
Can i create a new toolbar button which will format a cell in a particular
style?

I am trying to create a style similar to "Comma style" but without any
decimal places.



This is right from excel help file


Run a macro from a toolbar button
You can run a macro from a button on a built-in toolbar or a custom
toolbar. For information about creating a custom toolbar, click .

On the Tools menu, click Customize.
Show Me

If the toolbar that contains the button is not visible, click the
Toolbars tab, and then select the check box next to the toolbar name.


If the button you want to run the macro from is not on a toolbar, click
the Commands tab, and then click Macros in the Categories list. In the
Commands list, drag the Custom button onto a toolbar.


Right-click the toolbar button, and then click Assign Macro on the
shortcut menu.


In the Macro name box, enter the name of the macro.

-----------------------------------

use a macro like this

All I did was record the macro

Sub Format()
'
'
'

'
Selection.NumberFormat = "###,###"
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default New button on toolbar

Yes copy the following code into a module, this is the macro code that you
will need to reference when you create a custom macro button.

Sub comma0()
With Selected
Cells.NumberFormat = "0,000"
End With
End Sub

Hope this helps


"attaboy" wrote:

Can i create a new toolbar button which will format a cell in a particular
style?

I am trying to create a style similar to "Comma style" but without any
decimal places.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default New button on toolbar

Thnx
I created a macro in a file(say 1.xls) & linked it to a button, works OK in
1.xls; If 1.xls is closed and i try to apply the style in another file (say
2.xls), 1.xls opens up, how can this be avoided?

rgds

"damorrison" wrote:

attaboy wrote:
Can i create a new toolbar button which will format a cell in a particular
style?

I am trying to create a style similar to "Comma style" but without any
decimal places.



This is right from excel help file


Run a macro from a toolbar button
You can run a macro from a button on a built-in toolbar or a custom
toolbar. For information about creating a custom toolbar, click .

On the Tools menu, click Customize.
Show Me

If the toolbar that contains the button is not visible, click the
Toolbars tab, and then select the check box next to the toolbar name.


If the button you want to run the macro from is not on a toolbar, click
the Commands tab, and then click Macros in the Categories list. In the
Commands list, drag the Custom button onto a toolbar.


Right-click the toolbar button, and then click Assign Macro on the
shortcut menu.


In the Macro name box, enter the name of the macro.

-----------------------------------

use a macro like this

All I did was record the macro

Sub Format()
'
'
'

'
Selection.NumberFormat = "###,###"
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default New button on toolbar

Lots of people store these kinds of macros in a workbook named Personal.xls in
their XLStart folder. They use windows|Hide so that the workbook is hidden
while it's open.


attaboy wrote:

Thnx
I created a macro in a file(say 1.xls) & linked it to a button, works OK in
1.xls; If 1.xls is closed and i try to apply the style in another file (say
2.xls), 1.xls opens up, how can this be avoided?

rgds

"damorrison" wrote:

attaboy wrote:
Can i create a new toolbar button which will format a cell in a particular
style?

I am trying to create a style similar to "Comma style" but without any
decimal places.



This is right from excel help file


Run a macro from a toolbar button
You can run a macro from a button on a built-in toolbar or a custom
toolbar. For information about creating a custom toolbar, click .

On the Tools menu, click Customize.
Show Me

If the toolbar that contains the button is not visible, click the
Toolbars tab, and then select the check box next to the toolbar name.


If the button you want to run the macro from is not on a toolbar, click
the Commands tab, and then click Macros in the Categories list. In the
Commands list, drag the Custom button onto a toolbar.


Right-click the toolbar button, and then click Assign Macro on the
shortcut menu.


In the Macro name box, enter the name of the macro.

-----------------------------------

use a macro like this

All I did was record the macro

Sub Format()
'
'
'

'
Selection.NumberFormat = "###,###"
End Sub



--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 504
Default New button on toolbar

But once you have run the macro you cannot select undo (ctrl+z) is there any
other way of changing the default format of the existing comma button on the
toolbar?

"collies" wrote:

Yes copy the following code into a module, this is the macro code that you
will need to reference when you create a custom macro button.

Sub comma0()
With Selected
Cells.NumberFormat = "0,000"
End With
End Sub

Hope this helps


"attaboy" wrote:

Can i create a new toolbar button which will format a cell in a particular
style?

I am trying to create a style similar to "Comma style" but without any
decimal places.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro button on toolbar Lesley Excel Discussion (Misc queries) 2 August 28th 06 07:32 PM
How to increase size of image in button (msocontrolbutton) of custom toolbar of Excel padam Excel Discussion (Misc queries) 0 August 11th 06 07:18 PM
Creating a macro that simulates some of the toolbar button Duangruthai New Users to Excel 1 April 22nd 06 12:12 AM
Custom Toolbar Button No Longer Runs Assigned Macro Bryan Excel Discussion (Misc queries) 1 April 10th 06 06:02 PM
Toolbar button for superscript awertj Excel Discussion (Misc queries) 2 January 24th 06 01:06 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"