ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA to change font? (https://www.excelbanter.com/excel-discussion-misc-queries/80804-vba-change-font.html)

Steve

VBA to change font?
 
I have a workbook with several sheets. I inherited this workbook and it has
multiple fonts. I want code to change all fonts to a common font, say
Verdana or Arial but I want all other formatting to stay the same...like font
size, borders, etc.

Steve

VBA to change font?
 
Figured it out I think...this seems to work:


Sub set_fonts()

Dim sh As Worksheet

For Each sh In ActiveWorkbook.Worksheets
sh.Activate

Cells.Select
With Selection.Font
.Name = "Verdana"
End With

Next sh
End Sub




"Steve" wrote:

I have a workbook with several sheets. I inherited this workbook and it has
multiple fonts. I want code to change all fonts to a common font, say
Verdana or Arial but I want all other formatting to stay the same...like font
size, borders, etc.


dalsx1

VBA to change font?
 

How many sheets are you talking about?


--
dalsx1
------------------------------------------------------------------------
dalsx1's Profile: http://www.excelforum.com/member.php...o&userid=33041
View this thread: http://www.excelforum.com/showthread...hreadid=528560



All times are GMT +1. The time now is 12:18 AM.

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