Help adding font size / color / etc to my macro

blewth

New Member
Joined
Aug 9, 2016
Messages
15
Hi all

I have a few macros that I would like to adjust... I have inherited these macros and thus am a bit unfamiliar with how it all works, so any help would be greatly appreciated..

--------------------------------------------------------------------------------------------

Macro 1 - Blue fill

To add:
Fill color: 68 / 105 / 125
Size - 10
Font - Book Antiqua
Style - Bold
Font Color - White

Code:

With Selection.Interior
.ColorIndex = 49
.Pattern = xlSolid
End With
End Sub


Macro 2 - Grey fill

To add:
Fill color: 165 / 157 / 149
Size - 10
Font - Book Antiqua
Style - Bold
Font Color - Black

Code:

With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
End Sub



Macro 3 - Light brown fill

To add:
Fill Color - 225 / 222 / 174
Size - 10
Font - Book Antiqua
Style - Bold
Font Color - Black

Code:

With Selection.Interior
.ColorIndex = 19
.Pattern = xlSolid
End With
End Sub



Macro 4 - Book Antiqua font

To add:
Size - 10

Code:

With Selection.Font
.Name = "Book Antiqua"
End With
End Sub



Macro 5 - Font color green

To add:
Font color - Dark green (color index 10)

The below code will for some reason not work?

Code:

With Selection.Font
.ColorIndex = 10
End With
End Sub


-----------------------------------------------------------------------------------


Thank you all so much for your help
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

blewth

New Member
Joined
Aug 9, 2016
Messages
15
Macro 5 now working. But if you could help me with the others it would be appreciated. Thanks guys
 

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,631
Here are the requested pieces of code:
Code:
With Selection
    .Interior.Color = RGB(68, 105, 125)
    .Font.Name = "Book Antiqua"
    .Font.Size = 10
    .Font.Bold = True
    .Font.Color = vbWhite
End With
End Sub
......
With Selection
    .Interior.Color = RGB(165, 157, 149)
    .Font.Name = "Book Antiqua"
    .Font.Size = 10
    .Font.Bold = True
    .Font.Color = vbBlack
End With
End Sub
......
With Selection
    .Interior.Color = RGB(255, 222, 174)
    .Font.Name = "Book Antiqua"
    .Font.Size = 10
    .Font.Bold = True
    .Font.Color = vbBlack
End With
End Sub
......
With Selection.Font
    .Name = "Book Antiqua"
    .Size = 10
End With
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,122,653
Messages
5,597,377
Members
414,141
Latest member
Joey_T92

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