0

I'm new to VBA and need some assistance.

I created a new row with

ActiveCell.Select
Selection.Offset(1).EntireRow.Insert

Now, how do I select the new row for iRow =?

Community
  • 1
  • 1
Shabi Levanda
  • 11
  • 1
  • 1
  • You [do not need to select](http://stackoverflow.com/q/10714251/11683). If you are wondering about the index of the new row, that would be immediately above the one you used `Insert` against. – GSerg Aug 21 '16 at 11:23

1 Answers1

0

first thing off: always avoid Select/Selection and Activate/ActiveXXX

that being said, and having no clues of how differently refer to the ActiveCell, code like follows:

ActiveCell.Offset(1).EntireRow.Insert '<--| insert new line just below currently active cell

and then

irow = ActiveCell.Row + 1 '<--! get the row of the ActiveCell and add 1 to it
user3598756
  • 28,893
  • 4
  • 18
  • 28