ExcelScript.DataValidationPrompt interface

データ検証のユーザー プロンプト プロパティを表します。

注釈

/**
 * This script creates a text prompt that's shown in C2:C8 when a user enters the cell.
 */
function main(workbook: ExcelScript.Workbook) {
    // Get the data validation object for C2:C8 in the current worksheet.
    let selectedSheet = workbook.getActiveWorksheet();
    let dataValidation = selectedSheet.getRange("C2:C8").getDataValidation();

    // Clear any previous validation to avoid conflicts.
    dataValidation.clear();

    // Create a prompt to remind users to only enter first names in this column.
    const prompt: ExcelScript.DataValidationPrompt = {
      showPrompt: true,
      title: "First names only",
      message: "Only enter the first name of the employee, not the full name."
    }
    dataValidation.setPrompt(prompt);
}    

プロパティ

message

プロンプトのメッセージを指定します。

showPrompt

ユーザーがデータ検証を使用してセルを選択したときにプロンプトを表示するかどうかを指定します。

title

プロンプトのタイトルを指定します。

プロパティの詳細

message

プロンプトのメッセージを指定します。

message: string;

プロパティ値

string

showPrompt

ユーザーがデータ検証を使用してセルを選択したときにプロンプトを表示するかどうかを指定します。

showPrompt: boolean;

プロパティ値

boolean

title

プロンプトのタイトルを指定します。

title: string;

プロパティ値

string