Option Explicit
'このプロシージャから実行してください。
Sub main()
'フォントサイズを取得する
With Worksheets("Sheet1")
Debug.Print ("フォントサイズは" & Cells(1, 1).Font.Size)
End With
'フォントサイズを設定する
With Worksheets("Sheet1")
Cells(1, 1).Font.Size = 8
Cells(1, 1).Value = "エクセル VBA"
Cells(2, 1).Font.Size = 9
Cells(2, 1).Value = "エクセル VBA"
Cells(3, 1).Font.Size = 10
Cells(3, 1).Value = "エクセル VBA"
Cells(4, 1).Font.Size = 11
Cells(4, 1).Value = "エクセル VBA"
Cells(5, 1).Font.Size = 12
Cells(5, 1).Value = "エクセル VBA"
Cells(6, 1).Font.Size = 13
Cells(6, 1).Value = "エクセル VBA"
Cells(7, 1).Font.Size = 14
Cells(7, 1).Value = "エクセル VBA"
End With
'フォントサイズを取得する
With Worksheets("Sheet1")
Debug.Print ("フォントサイズは" & Cells(1, 1).Font.Size)
End With
End Sub
このサイトはリンクフリーです。リンクを貼る際に連絡は不要です。
© EXCEL VBA リファレンス all rights reserved.