文字に下線を設定する(Underline プロパティ)
2015/08/26
下線を設定(Underline プロパティ)
Underline プロパティは、文字に下線を設定します。設定には、XlUnderlineStyle 列挙型の定数を使用します。値の取得および設定が可能です。
【書式】
<取得>
object.Underline
<設定>
object.Underline = const
引数・戻り値
- object ・・・ 対象となる Font オブジェクトを指定します。
- const ・・・ 下線の種類を表すXlUnderlineStyle 列挙型の定数を指定します。
定数 値 内容 xlUnderlineStyleNone -4142 下線なし xlUnderlineStyleSingle 2 一重下線 xlUnderlineStyleDouble -4119 二重下線 xlUnderlineStyleSingleAccounting 4 一重下線(会計) xlUnderlineStyleDoubleAccounting 5 二重下線(会計)
下線を設定(Underline プロパティ)使用例
サンプルVBAソース
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
Sub Sample_Font06() Range("B3:F3").Value = "aaa" '一重下線 Range("B3").Font.Underline = xlUnderlineStyleSingle '二重下線 Range("C3").Font.Underline = xlUnderlineStyleDouble '一重下線(会計) Range("D3").Font.Underline = xlUnderlineStyleSingleAccounting '二重下線(会計) Range("E3").Font.Underline = xlUnderlineStyleDoubleAccounting '下線なし Range("F3").Font.Underline = xlUnderlineStyleNone End Sub |
実行結果
関連記事
-
-
日付時刻:経過時間を取得( Timer 関数 )
Timer 関数の使い方 【書式】 result = Timer () 【戻り値 …
-
-
VBA の演算子(比較演算子)
比較演算子 比較演算子による演算の結果は「真」の場合は「True」、「偽」の場合 …
-
-
変数がNull 値かどうかをチェックする( IsNull 関数 )
IsNull 関数の使い方 【書式】 result = IsNull ( exp …
-
-
メッセージボックスを表示(MsgBox関数)
MsgBox関数 【書式】 result = MsgBox ( Prompt [ …
-
-
日付時刻:日付時刻データを計算( DateAdd 関数 )
DateAdd 関数(日付・時刻の値を加算・減算結果を取得) 【書式】 resu …
-
-
指定した値を16進数で表記した文字列に変換する(Hex 関数)
Hex 関数 の使い方 【書式】 result = Hex ( expressi …
-
-
変数が数値型かどうかをチェックする( IsNumeric 関数 )
IsNumeric 関数の使い方 【書式】 result = IsNumeric …
-
-
色の設定(ThemeColor プロパティ・TintAndShade プロパティ)
ThemeColor プロパティ・TintAndShade プロパティ テーマカ …
-
-
Math 関数( Abs,Atn,Cos,Exp,Log,Rnd,Sgn,Sin,Sqr,Tan )
Abs 関数 【書式】 value = Abs ( number ) 【引数・戻 …
-
-
フォント名(Name,ThemeFont,StandardFont)
フォント名を取得・設定する(Name プロパティ) Name プロパティは、オブ …
