ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formating Macro (https://www.excelbanter.com/excel-programming/281437-formating-macro.html)

Brady Snow

Formating Macro
 
I want to apply this macro to all the workshhets in a
workbook.

Sub Change_Font()
Cells.Font.Name = "Arial"

End Sub

How would I code this to change all the cells in all the
worksheets?

Many Thanks,

Brady Snow

McKinney, Texas

Don Guillett[_4_]

Formating Macro
 
have a look at formatstyle
just recorded this. Delete what you don't need
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 11/4/2003 by Don Guillett
'

'
With ActiveWorkbook.Styles("Normal")
.IncludeNumber = True
.IncludeFont = True
.IncludeAlignment = True
.IncludeBorder = True
.IncludePatterns = True
.IncludeProtection = True
End With
With ActiveWorkbook.Styles("Normal").Font
.Name = "Antique Olive Roman"
.Size = 10
.Bold = False
.Italic = False
.Underline = xlUnderlineStyleNone
.Strikethrough = False
.ColorIndex = xlAutomatic
End With
Selection.Style = "Normal"
End Sub

"Brady Snow" wrote in message
...
I want to apply this macro to all the workshhets in a
workbook.

Sub Change_Font()
Cells.Font.Name = "Arial"

End Sub

How would I code this to change all the cells in all the
worksheets?

Many Thanks,

Brady Snow

McKinney, Texas




Pete McCosh[_7_]

Formating Macro
 

Sub Change_Font()
Dim wk as worksheet

For Each wk in ThisWorkbook.Worksheets
wk.Cells.Font.Name = "Arial"
Next wk

end Sub

-----Original Message-----
I want to apply this macro to all the workshhets in a
workbook.

Sub Change_Font()
Cells.Font.Name = "Arial"

End Sub

How would I code this to change all the cells in all the
worksheets?

Many Thanks,

Brady Snow

McKinney, Texas
.



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

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