0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Excelですべてのフォントとフォントサイズを統一するマクロ

Posted at

Excelですべてのフォントとフォントサイズを統一するマクロ

マクロをアドインとして登録する手順

Excelを便利に!アドインの作成

マクロ

すべてのシートに対してフォントを[Meiryo UI]に、フォントサイズを[9pt]に変更する

Sub フォント変更()
    Dim ws As Worksheet
    Dim cell As Range
    
    ' 全てのワークシートに適用
    For Each ws In ThisWorkbook.Sheets
        ws.Cells.Font.Name = "Meiryo UI"
        ws.Cells.Font.Size = 9
    Next ws
    
    MsgBox "すべてのフォントを変更しました!", vbInformation, "完了"
End Sub

開いているアクティブなシートにのみ適用する

Sub フォント変更()
    Dim ws As Worksheet
    Set ws = ActiveSheet ' 現在アクティブなシートを取得
    
    ws.Cells.Font.Name = "Meiryo UI"
    ws.Cells.Font.Size = 9
    
    MsgBox "アクティブなシートのフォントを変更しました!", vbInformation, "完了"
End Sub
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?