文字に下線を設定する(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 |
実行結果
関連記事
-
-
データ型変換関数
データ型変換関数の使い方 【書式】 function ( expression …
-
-
変数がNull 値かどうかをチェックする( IsNull 関数 )
IsNull 関数の使い方 【書式】 result = IsNull ( exp …
-
-
RGB 値一覧表(XlRgbColor 列挙型)
RGB 値(XlRgbColor 列挙型)一覧表 RGB 関数を使用して、出力さ …
-
-
変数が日付型かどうかをチェックする( IsDate 関数 )
IsDate 関数の使い方 【書式】 result = IsDate( expr …
-
-
変数がEmpty 値かどうかをチェックする( IsEmpty 関数 )
IsEmpty 関数の使い方 【書式】 result = IsEmpty ( e …
-
-
書式を変換(Format 関数)
Format 関数の使い方 【書式】 result = Format ( exp …
-
-
インプットボックスを表示する(InputBox関数・InputBoxメソッド)
「InputBox関数」と「InputBoxメソッド」の違い 「InputBox …
-
-
四捨五入・切り上げ・切り捨て・丸め(Round 関数 他)
Round 関数(丸め)の使い方 【書式】 value = Round ( ex …
-
-
Math 関数( Abs,Atn,Cos,Exp,Log,Rnd,Sgn,Sin,Sqr,Tan )
Abs 関数 【書式】 value = Abs ( number ) 【引数・戻 …
-
-
メッセージボックスを表示(MsgBox関数)
MsgBox関数 【書式】 result = MsgBox ( Prompt [ …
