入力規則(日本語入力)Validation オブジェクト,IMEMode プロパティ
IMEMode プロパティ
Validation.IMEMode プロパティ を使うと、セルごとに日本語入力モードのオン/オフを切り替えたり、半角英数字のみ入力を許可したりといったことができます。
【書式】
object.IMEMode = const
引数・戻り値
- object ・・・ 対象となる Validation オブジェクトを指定します。
- const ・・・ 日本語入力規則の内容を表す XlIMEMode 列挙型 の定数またはその値を指定します。
定数 値 内容 xlIMEModeNoControl 0 コントロールなし xlIMEModeOn 1 モード オン xlIMEModeOff 2 オフ (英語モード) xlIMEModeDisable 3 無効 xlIMEModeHiragana 4 ひらがな xlIMEModeKatakana 5 カタカナ xlIMEModeKatakanaHalf 6 半角カタカナ xlIMEModeAlphaFull 7 全角英数字 xlIMEModeAlpha 8 半角英数字
入力規則(日本語入力)使用例
サンプルVBAソース
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
Sub Sample05_Validation() With Range("B3:B10").Validation '入力規則を削除 .Delete '入力規則を設定 '入力の制限なし .Add Type:=xlValidateInputOnly, _ AlertStyle:=xlValidAlertStop .IgnoreBlank = True '空白を無視 .IMEMode = xlIMEModeOn '自動的に日本語入力モードをオン End With End Sub |
実行結果
入力規則を設定したセルに入力
関連記事
-
-
セルの高さ・幅を取得(Height プロパティ・Width プロパティ)
Height プロパティ・Width プロパティ Height プロパティは、指 …
-
-
列名を取得、列番号を取得(Address プロパティ,Column プロパティ)
列番号を取得する セル番地(「A1」や「B3」)や列名(「A」「B」「C」 …
-
-
文字列の横位置を取得・設定する(HorizontalAlignment プロパティ)
HorizontalAlignment プロパティ HorizontalAlig …
-
-
オートフィルタ(アイコンで抽出する)AutoFilter メソッド
オートフィルタ(アイコンで抽出する) Excel 2007 から、条件付き書式で …
-
-
対象のセルが参照している全てのセルを取得(Precedents プロパティ)
Precedents プロパティ Precedents プロパティは、対象のセル …
-
-
セルのアドレスを確認(Address プロパティ)
Address プロパティ Address プロパティ・AddressLocal …
-
-
行・列の表示・非表示(Hidden プロパティ)
Hidden プロパティ Hidden プロパティに True を設定することで …
-
-
入力規則(エラーメッセージの設定)Validation オブジェクト
無効値を入力時に、エラーメッセージの表示 Validation.ShowErro …
-
-
セル幅・高さの既定値(StandardHeight プロパティ・StandardWidth プロパティ)
StandardHeight プロパティ・StandardWidth プロパティ …
-
-
オートフィルタの状況を確認(AutoFilterMode, FilterMode)
AutoFilterMode プロパティ AutoFilterMode プロパテ …
