Florian
Florian

Reputation: 51

VBA for Excel: How to easily reference to index of the active cell

I'm looking for a way to reference to the row and column indices of the currently active cell. I tried something like

Cells(ActiveCell.RowIndex, 5).Value = "something"

But that gave me run time error 438.

Upvotes: 1

Views: 9103

Answers (1)

David Zemens
David Zemens

Reputation: 53623

You will use:

ActiveCell.Row and ActiveCell.Column

I would use it like:

Range(ActiveCell.Row, 5).Value = "something"

Upvotes: 2

Related Questions