|
|
|||||||||
| 本章では、セルの書式設定に関するコードサンプルを例示しています。 | |||||||||
|
|||||||||
|
Font
<記述例> Range("A1").Font |
|||||||||
|
|||||||||
|
|
Font.Name = フォント名(文字列) <記述例> Range("A1").Font.Name = "MS 明朝" |
||||||||
|
|||||||||
| Font.Size = 設定値(整数) <記述例> Range("A1").Font.Size = 14 |
|||||||||
|
|
|||||||||
|
|||||||||
|
Bold = 設定値(論理値)
使用例 セル「A1」のフォントを太字にする Worksheets("Sheet1").Range("A1").Font.Bold = True プロパティ
目的 |
|||||||||
|
|||||||||
|
Underline = 線種(定数)
<記述例> Range("A1").Font.Underline = xlUnderlineStyleSingle 定数 線種 ------------------------------------------- xlUnderlineStyleNone 下線なし xlUnderlineStyleSingle 直線 xlUnderlineStyleDouble 二重線 xlUnderlineStyleSingleAccounting 直線(会計) xlUnderlineStyleDoubleAccounting 二重線(会計) |
|||||||||
|
|||||||||
|
Characters(開始位置,文字数)
<記述例> Range("A1").Characters(1, 2) .Font.Italic = True |
|||||||||
|
|||||||||
|
ColorIndex = 色番号
<記述例> Range("A1:B4").Font.ColorIndex = 6 色番号 色 色番号 色 ----------------------------------- 1 黒 7 マゼンタ 2 白 8 シアン 3 赤 9 茶 4 明るい緑 10 緑 5 青 11 紺 6 明るい黄色 12 うぐいす |
|||||||||
|
|||||||||
|
Color = 設定値(16進数またはRGB関数の戻り値)
<記述例> Range("A1").Font.Color = &HFFF Range("A1").Font.Color = RGB(0, 255, 0) |
|||||||||
|
|||||||||
| RGB(Red, Green, Blue) <記述例> セル「A1」のフォントをサーモン色に設定する> Worksheets("Sheet1").Range("A1").Font.Color = RGB(250, 80, 160) |
|||||||||
|
|||||||||
| Interior <記述例> Range("A1").Interior |
|||||||||
|
|||||||||
| ColorIndex = 色番号 <記述例> Range("A1").Interior.ColorIndex = 6 |
|||||||||
|
|||||||||
| Color = 設定値(16進数またはRGB関数の戻り値) <記述例> Range("A1").Interior.Color = RGB(255, 255, 0) |
|||||||||
|
|||||||||
| Pattern = 設定値(定数) <記述例> Range("A1").Interior.Pattern = xlChecker <定数> xlPatternAutomatic xlPatternChecker xlPatternCrissCross xlPatternDown xlPatternGray16 xlPatternGray25 xlPatternGray50 xlPatternGray75 xlPatternGray8 xlPatternGrid xlPatternHorizontal xlPatternLightDown xlPatternLightHorizontal xlPatternLightUp xlPatternLightVertical xlPatternNone xlPatternSemiGray75 xlPatternSolid xlPatternUp xlPatternVertical |
|||||||||
|
|||||||||
| PatternColorIndex = 色番号 <記述例> Range("A1").Interior.PatternColorIndex = 6 PatternColor = 設定値(16進数またはRGB関数の戻り値) <記述例> Range("A1").Interior.PatternColor = &HFF Range("A1").Interior.PatternColor = RGB(255, 255, 0) |
|||||||||
| ご意見・ご感想をお寄せください。info@beagle-hc.com ‖ このサイトについて | |||||||||
| Copyright 2006 - 2009 uTRAM Corp. All Rights Reserved | |||||||||