Option Explicit
'このプロシージャから実行してください。
Sub main()
'セルのフォント装飾設定を取得する
With Worksheets("Sheet1")
Debug.Print ("太字設定は" & Cells(1, 1).Font.Bold)
Debug.Print ("斜体設定は" & Cells(1, 1).Font.Italic)
Debug.Print ("下線設定は" & Cells(1, 1).Font.Underline)
Debug.Print ("取消線設定は" & Cells(1, 1).Font.Strikethrough)
End With
'セルのフォント装飾設定を設定する
With Worksheets("Sheet1")
Cells(1, 1).Font.Bold = True
Cells(1, 1).Value = "エクセル VBA"
Cells(2, 1).Font.Italic = True
Cells(2, 1).Value = "エクセル VBA"
Cells(3, 1).Font.Underline = True
Cells(3, 1).Value = "エクセル VBA"
Cells(4, 1).Font.Strikethrough = True
Cells(4, 1).Value = "エクセル VBA"
End With
'セルのフォント装飾設定を取得する
With Worksheets("Sheet1")
Debug.Print ("太字設定は" & Cells(1, 1).Font.Bold)
Debug.Print ("斜体設定は" & Cells(1, 1).Font.Italic)
Debug.Print ("下線設定は" & Cells(1, 1).Font.Underline)
Debug.Print ("取消線設定は" & Cells(1, 1).Font.Strikethrough)
End With
End Sub
このサイトはリンクフリーです。リンクを貼る際に連絡は不要です。
© EXCEL VBA リファレンス all rights reserved.