Excel.WorksheetChangedEventArgs interface
変更されたイベントを発生させたワークシートに関する情報を提供します。
注釈
プロパティ
| address | 特定のワークシートで変更されたエリアを表す範囲のアドレスを取得します。 |
| change |
変更されたイベントのトリガー方法を表す変更の種類を取得します。 詳細は「 |
| details | 変更の詳細に関する情報を表します。 このプロパティは、変更されたイベントが 1 つのセルでトリガーされたときに取得できます。 変更されたイベントが複数のセルでトリガーされた場合、このプロパティを取得できません。 |
| source | イベントのソースを取得します。 詳細は「 |
| type | イベントの種類を取得します。 詳細は「 |
| worksheet |
データが変更されたワークシートの ID を取得します。 |
メソッド
| get |
特定のワークシートで変更されたエリアを表す範囲を取得します。 |
| get |
特定のワークシートで変更されたエリアを表す範囲を取得します。 null オブジェクトを返すこともあります。 |
プロパティの詳細
address
changeType
変更されたイベントのトリガー方法を表す変更の種類を取得します。 詳細は「Excel.DataChangeType」をご覧ください。
changeType: Excel.DataChangeType | "Unknown" | "RangeEdited" | "RowInserted" | "RowDeleted" | "ColumnInserted" | "ColumnDeleted" | "CellInserted" | "CellDeleted";
プロパティ値
Excel.DataChangeType | "Unknown" | "RangeEdited" | "RowInserted" | "RowDeleted" | "ColumnInserted" | "ColumnDeleted" | "CellInserted" | "CellDeleted"
注釈
details
変更の詳細に関する情報を表します。 このプロパティは、変更されたイベントが 1 つのセルでトリガーされたときに取得できます。 変更されたイベントが複数のセルでトリガーされた場合、このプロパティを取得できません。
details: Excel.ChangedEventDetail;
プロパティ値
注釈
例
// This function would be used as an event handler for the Worksheet.onChanged event.
async function onWorksheetChanged(eventArgs) {
await Excel.run(async (context) => {
const details = eventArgs.details;
const address = eventArgs.address;
// Print the before and after types and values to the console.
console.log(`Change at ${address}: was ${details.valueBefore}(${details.valueTypeBefore}),`
+ ` now is ${details.valueAfter}(${details.valueTypeAfter})`);
await context.sync();
});
}
source
イベントのソースを取得します。 詳細は「Excel.EventSource」をご覧ください。
source: Excel.EventSource | "Local" | "Remote";
プロパティ値
Excel.EventSource | "Local" | "Remote"
注釈
type
イベントの種類を取得します。 詳細は「Excel.EventType」をご覧ください。
type: "WorksheetChanged";
プロパティ値
"WorksheetChanged"
注釈
worksheetId
メソッドの詳細
getRange(ctx)
特定のワークシートで変更されたエリアを表す範囲を取得します。
getRange(ctx: Excel.RequestContext): Excel.Range;
パラメーター
戻り値
getRangeOrNullObject(ctx)
特定のワークシートで変更されたエリアを表す範囲を取得します。 null オブジェクトを返すこともあります。
getRangeOrNullObject(ctx: Excel.RequestContext): Excel.Range;