Notice: Constant SAVEQUERIES already defined in /home/uwsc/domains/uwsc.jp/public_html/wp-config.php on line 125

Notice: 関数 wp_add_inline_script が誤って呼び出されました。<script> タグを wp_add_inline_script() に渡さないでください。 詳しくは WordPress のデバッグをご覧ください。 (このメッセージはバージョン 4.5.0 で追加されました) in /home/uwsc/domains/uwsc.jp/public_html/wp-includes/functions.php on line 5905

Notice: Undefined variable: post in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 147

Notice: Undefined variable: post in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 154

Notice: Trying to get property 'ID' of non-object in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 154
Application.ActiveCell プロパティ | UWSC辞典


Notice: Trying to access array offset on value of type null in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 27

Notice: Trying to access array offset on value of type null in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 31
Application.ActiveCell プロパティ

本ページには広告が含まれています。


Notice: Undefined offset: 1 in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 188

Notice: Trying to access array offset on value of type null in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 55

Notice: Trying to access array offset on value of type null in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 13

Warning: in_array() expects parameter 2 to be array, string given in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 41

Warning: in_array() expects parameter 2 to be array, string given in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 41

Warning: in_array() expects parameter 2 to be array, string given in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 41

Notice: Undefined variable: id in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 61

Notice: Trying to access array offset on value of type null in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 27

Warning: in_array() expects parameter 2 to be array, null given in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 41

Notice: Undefined variable: html in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 23

アクティブなセルを表すRange オブジェクトを取得します。セル範囲を選択している場合もアクティブなセルは1つです。クティブなセルがない(グラフシートを選択しているなどの)場合は、NOTHINGが返されます。

構文
  1. Range = Application.ActiveCell
引数
戻り値
Range オブジェクト

Application オブジェクトを返すメソッド・プロパティ

Application.ActiveCell プロパティ
Microsoft Excelアプリケーションを表すApplication オブジェクトを返します。
Borders.Application プロパティ
Excel.ActiveCellが属するApplication オブジェクトを返します。

使い方

アクティブセルのアドレスを返します。

UWSC
DIM Range = Excel.Application.ActiveCell
PRINT Range.Address
.png
結果
プレーンテキスト
$A$1

セル範囲が選択されている場合も返す値は1つです。

UWSC
DIM Range = Excel.Application.ActiveCell
PRINT Range.Address
.png
結果
プレーンテキスト
$C$7

アクティブセルの行番号と列番号を出力します。

UWSC
DIM Range = Excel.Application.ActiveCell

WITH Range
	PRINT .Row
	PRINT .Column
ENDWITH
.png
結果
プレーンテキスト
3
2

プログラム実行例

アクティブセルに文字列を入力する

UWSC
DIM Excel = CREATEOLEOBJ("Excel.Application")
Excel.Visible = TRUE
Excel.Workbooks.Add()

DIM Range = Excel.Application.ActiveCell
SLEEP(1.000)
Range.Value = "abc"
SLEEP(3.000)

Excel.Application.DisplayAlerts = FALSE
Excel.Quit
使用関数

関連記事

Range オブジェクト
セル、行、列、連続した1つ以上のセル範囲を表します。
Application.Cells プロパティ (Excel)
作業中のワークシートのすべてのセルを表すRange オブジェクトを返します。
Range.Activate メソッド (Excel)
1つのセルをアクティブにします。セルは現在の選択範囲内にある必要があります。セルの範囲を選択するには、Selectメソッドを使用します。
Range.AutoFill メソッド (Excel)
指定された対象セル範囲内のセルに対してオートフィルを実行します。
Range.AutoFilter メソッド (Excel)
オートフィルターを使ってリストをフィルター処理します。
Range.ClearComments メソッド (Excel)
指定されたセル範囲からすべてのコメントを消去します。
Range.ClearHyperlinks メソッド (Excel)
指定された範囲からすべてのハイパーリンクを削除します。
Range.Copy メソッド (Excel)
範囲を、指定の範囲またはクリップボードにコピーします。
Range.DiscardChanges メソッド (Excel)
編集されたセル範囲内のすべての変更を破棄します。
Range.NumberFormatLocal プロパティ (Excel)