PC Review


Reply
Thread Tools Rate Thread

Customizing a toolbar icon

 
 
Hans Knudsen
Guest
Posts: n/a
 
      14th Oct 2008
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 With Quote
 
 
 
 
ShaneDevenshire
Guest
Posts: n/a
 
      15th Oct 2008
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 With Quote
 
Hans Knudsen
Guest
Posts: n/a
 
      15th Oct 2008
Shane Devenshire

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

Hans


"ShaneDevenshire" <(E-Mail Removed)> wrote in
message news:4FED079A-5FE5-4E64-83E5-(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change icon when customizing Quick Access Toolbar commands kaytee Microsoft Word Document Management 1 16th Jan 2008 06:16 PM
Customizing toolbar with templates icon =?Utf-8?B?THdicm93bg==?= Microsoft Word Document Management 6 13th Apr 2007 07:34 PM
Customizing the toolbar Icon BigOil Microsoft Excel Programming 3 27th Nov 2004 09:10 AM
Re: Customizing the toolbar Icon Rob van Gelder Microsoft Excel Programming 0 26th Nov 2004 11:13 PM
i need help customizing toolbar marcia Windows XP Internet Explorer 2 20th Apr 2004 07:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:08 AM.