How do you set the font size using VBA?

razzandy

Active Member
Joined
Jun 26, 2002
Messages
390
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

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Font size 8:

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

The macro recorder is good for finding out about print headers and footers.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,857
Members
449,051
Latest member
excelquestion515

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