Forum

Notifications
Clear all

Quick Access Tool Bar - Format Cells - Alignment Center Across Selection Button

3 Posts
3 Users
0 Reactions
200 Views
 bert
(@bertaaametal-com)
Posts: 1
New Member
Topic starter
 

I use the format cells - center across selection quite often and try to avoid Merge & Center commands.

 

I've tried to find a command to add to my quick access tool bar, but have never found such a button.

 

Does anyone know if it exists and what is called?

 

Cheers.

Bert

 
Posted : 25/06/2016 12:04 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Bert,

I don't think there's a command that exists for that, but you could record your own Macro and then assign it to an icon in your QAT.

Mynda

 
Posted : 28/06/2016 3:09 am
(@Anonymous)
Posts: 0
New Member Guest
 

Bert

Further to Mynda's post, here is the code that I use for a button on my QAT to do what you're after (plus wrap text within the cell):

Sub WrapAcross()
    
    On Error GoTo NoStyle    ' If Wrap Across is not available as a style
    Selection.Style = "WrapAcrossSelection"      'Modify this style to change the formatting selections
    Exit Sub
    
 NoStyle:        ' If Wrap Across style is not available
     With Selection
         .HorizontalAlignment = xlCenterAcrossSelection
         .VerticalAlignment = xlCenter
         .WrapText = True
         .Orientation = 0
         .ShrinkToFit = False
         .MergeCells = False
     End With
     
 End Sub
 
Posted : 28/06/2016 5:07 am
Share: