Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Customizing a toolbar icon

Is it possible to have the Center icon perform a double job like for example
the Sort Ascending icon (Shift+Sort Ascending and sort is performed in
descending order) so that if I pres Shift+Center the following code should
run:

Sub SelectionCenterAcross()
On Error Resume Next
Selection.HorizontalAlignment = xlCenterAcrossSelection
End Sub

Regards
Hans Knudsen

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,344
Default Customizing a toolbar icon

Hi Hans,

There already is a second function assigned to the Center button - it is
Merge and Center. Just hold down the shift key for this functionality.

If you want a button for Center Across Selection you can add a new blank
button to the any toolbar and assign you macro to it. To add a button -
choose View, Toolbars, Customize, Commands tab, Macros Categroy, and drag
Custom Button to the toolbar. Then right click the new button and choose
Assign Macro and pick your code.
--
Thanks,
Shane Devenshire


"Hans Knudsen" wrote:

Is it possible to have the Center icon perform a double job like for example
the Sort Ascending icon (Shift+Sort Ascending and sort is performed in
descending order) so that if I pres Shift+Center the following code should
run:

Sub SelectionCenterAcross()
On Error Resume Next
Selection.HorizontalAlignment = xlCenterAcrossSelection
End Sub

Regards
Hans Knudsen

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Customizing a toolbar icon

Shane Devenshire

Thank you.
I wasn't aware that 'Center' already has this double function.

Hans


"ShaneDevenshire" wrote in
message ...
Hi Hans,

There already is a second function assigned to the Center button - it is
Merge and Center. Just hold down the shift key for this functionality.

If you want a button for Center Across Selection you can add a new blank
button to the any toolbar and assign you macro to it. To add a button -
choose View, Toolbars, Customize, Commands tab, Macros Categroy, and drag
Custom Button to the toolbar. Then right click the new button and choose
Assign Macro and pick your code.
--
Thanks,
Shane Devenshire


"Hans Knudsen" wrote:

Is it possible to have the Center icon perform a double job like for
example
the Sort Ascending icon (Shift+Sort Ascending and sort is performed in
descending order) so that if I pres Shift+Center the following code
should
run:

Sub SelectionCenterAcross()
On Error Resume Next
Selection.HorizontalAlignment = xlCenterAcrossSelection
End Sub

Regards
Hans Knudsen


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
Customizing toolbar in Excel2007? mikelee101 Excel Discussion (Misc queries) 1 May 19th 09 07:59 PM
Customizing Toolbar Buttons Leo Minervini Excel Discussion (Misc queries) 0 April 6th 05 02:17 AM
Customizing the toolbar Icon BigOil Excel Programming 3 November 27th 04 09:10 AM
Customizing the toolbar Icon Rob van Gelder[_4_] Excel Programming 0 November 26th 04 11:13 PM
Customizing Toolbar terri Excel Programming 1 February 11th 04 04:33 PM


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

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

About Us

"It's about Microsoft Excel"