vb for font / alignment etc

Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
675
Office Version
  1. 365
Platform
  1. Windows
good day,

I know I can do part via'record macro, but there is some code that I do not have any idea on 'how to'?

Could some kind coder sort some vb so when any cell within the range A1- S1000 changes the VB will auto run to apply the following:-


Font & size
Range a1 – s 1000
Calibri Light,16
Alignment
Range a1 – s1000
Centre , middle

Goto last cell used
Font & size
Range a1 – s 1000
Calibri Light,16
Alignment
Range a1 – s1000
Centre , middle

Goto last cell used

Hoping someone can sort?

MTIA
Trevor3007
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Try this. Put the following code in the events of your sheet.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Application.ScreenUpdating = False
    With Range("A1:S1000")
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .Font.Name = "Calibri Light"
        .Font.Size = 16
    End With
End Sub

SHEET EVENT
Right click the tab of the sheet you want this to work, select view code & paste the code into the window that opens up.
 
Upvote 0
morning danteamor,

Thank you ...it works a treat & I also Incorporated adding 'all borders' too ..yeah nice one.

Have great day & lovely Easter too.
KR
Trevor3007:beerchug:
 
Upvote 0
I'm glad to help you. I appreciate your kind comments.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,155
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top