2

and i want to create a macro in excel that add a row when i reach a certain cell. any help appreciated

1 Answer 1

3

You can add the below to the SelectionChange event of the worksheet and change the condition as necessary.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If ActiveCell.Row = 2 Then
    Selection.EntireRow.Insert
End If

End Sub
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.