VBA Cell Font – Change Color, Size, Style, & More
What is VBA-Excel
Excel VBA Application object is the one of the most frequently used object while automating any task with VBA. We refer different Excel applications and perform various operations on Excel Workbooks. We have different Properties, Methods to deal with Excel Application Object. Here you can find a brief explanation about each on most useful Properties and Methods while automating any task Our objective of building this Excel VBA Explorer is to provide suitable examples on most frequently used methods and properties of Application object. So that you can quickly find the solution, syntax whenever you required it.
Font
The Font property of the Range object in Excel VBA gives access to many other properties. That is because the Font property returns an object itself; the Font object. The Font object has many properties like the Color property and the bold property.
Color Property
To change the color of an Excel range, use the Font property of the Range object, and then the Color property of the Font object.
Example
Range("B1:B10").FontName="Calibri"
VBA Font Size
Font object also gives you access to the size property of the font. Let’s say you want to apply the font size of 15 to the font in the cell B1:B10, the code would be
Example
Range("B1:B10").Font.Size = 15
VBA Font Underline
There are also properties that you can use to make the font underline.
Example
Range("B1:B10").font.Name="Underline"=True
Please Watching My Video is Below
No comments:
Post a Comment