ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Check font of a cell (https://www.excelbanter.com/excel-programming/444955-check-font-cell.html)

Subodh

Check font of a cell
 
I want to check in a range of cells, the font of the cells. If the
font is not Times new roman
it makes the font to times new roman
and the font size to 10
also, if the font (Times New Roman) is not installed in the system
it should give a message and/or a notice.
Any tips will be appreciated
Thanks in advance.




Matthew Dyer

Check font of a cell
 
On Sep 16, 1:38*pm, Subodh wrote:
I want to check in a range of cells, the font of the cells. If the
font is not Times new roman
it makes the font to times new roman
and the font size to 10
also, if the font (Times New Roman) is not installed in the system
it should give a message and/or a notice.
Any tips will be appreciated
Thanks in advance.


assuming you've already defined your range as myrange-

on error goto err1
with myrange.font
..name = "Times New Roman"
..size = 10
end with
on error goto 0
err1:
msgbox("Times New Roman is not an available font")



All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com