Return to VBA Code Examples

VBA – アクティブセルの行や列を取得する

このチュートリアルでは、アクティブセルの列や行を取得する方法を説明します。

アクティブセルの列

このプロシージャは、アクティブセルの列番号を メッセージボックスに出力します。

Public Sub ActiveColumn()
  MsgBox ActiveCell.Column
End Sub

アクティブセルの行

こちらはアクティブセルの行を出力します。

Public Sub ActiveRow()
  MsgBox ActiveCell.Row
End Sub

VBAのコーディングが簡単に

VBAのコードをネットで探すのはもうやめましょう。AutoMacro – A VBA Code Builderを使えば、初心者が最小限の知識でコーディング出来るだけでなく、ベテランユーザーが時間を節約するのに役立つ多くの機能も備えています!

alt text もっと詳しく

vba-free-addin

VBA Code Examples Add-in

Easily access all of the code examples found on our site.

Simply navigate to the menu, click, and the code will be inserted directly into your module. .xlam add-in.

(No installation required!)

Free Download

Return to VBA Code Examples