入力規則(日本語入力)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 |
実行結果
入力規則を設定したセルに入力
関連記事
-
-
数式を設定・取得する(Formula プロパティ・FormulaR1C1 プロパティ)
Formula プロパティ(FormulaR1C1 プロパティ) Formula …
-
-
行の高さを取得・設定・する(RowHeight プロパティ)
RowHeight プロパティ RowHeight プロパティは、対象セルの高さ …
-
-
対象のセルを直接参照しているセル全てを取得(DirectDependents プロパティ)
DirectDependents プロパティ DirectDependents …
-
-
文字列の縦位置を取得・設定する(VerticalAlignment プロパティ)
VerticalAlignment プロパティ VerticalAlignmen …
-
-
数式を非表示にする(FormulaHidden プロパティ)
FormulaHidden プロパティ 数式が入力されたセルを選択するとその数式 …
-
-
任意の行または列を参照(Rows プロパティ,Columns プロパティ)
Rows プロパティ・Columns プロパティ Rows プロパティは、オブジ …
-
-
セルの表示形式を設定・取得する(NumberFormat プロパティ)
NumberFormat プロパティ NumberFormat プロパティは、現 …
-
-
重複するデータを削除(RemoveDuplicates メソッド)
RemoveDuplicates メソッド 指定したセル範囲から重複データを含む …
-
-
セル範囲内を検索(Find メソッド)
Find メソッド 指定したセル範囲内の特定の情報を含むセルを検索します。 【書 …
-
-
セル範囲を結合・結合を解除(MergeCells プロパティ)
MergeCells プロパティ MergeCells プロパティは、指定したセ …
