How do you set the font size using VBA?

razzandy

Active Member
Joined
Jun 26, 2002
Messages
388
Office Version
  1. 2007
Platform
  1. Windows
I’ve written the below code but I need to have the font size set to 8 point, can anybody me out? :(

Private Sub ComboBox3_Change()
Worksheets("Schedule").PageSetup.LeftHeader = ComboBox3.Column(0) _
& Chr(10) & ComboBox3.Column(1) & Chr(10) & ComboBox3.Column(2) _
& Chr(10) & ComboBox3.Column(3) & Chr(10) & ComboBox3.Column(4) _
& Chr(10) & ComboBox3.Column(5)
End Sub

Thanks in advance

Ryan UK :wink:
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Font size 8:

'Worksheets("Schedule").PageSetup.LeftHeader = "&8" & ComboBox3.Column(0).............

The macro recorder is good for finding out about print headers and footers.
 

Joe Was

MrExcel MVP
Joined
Feb 19, 2002
Messages
7,539
Sub myFont()
'
With Selection.Font
.Name = "Arial"
.Size = 12
.ColorIndex = xlAutomatic
End With
End Sub

And just for "size."

Selection.Font.Size = 12

Hope this helps. JSW
 

Forum statistics

Threads
1,144,360
Messages
5,723,902
Members
422,525
Latest member
dsenff

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
Top