Inserting a row above the current row
I have a very simple problem but am new to VB and cant figure out why I am getting errors.
What I am trying to do is set up a macro that copies row # 10 and inserts it above the current active row.
I have searched multiple web pages but everyone seems to code things differently and I cant get a grasp on understanding the VBA commands via analyzing codes.
I keep getting:
- "Insert/Copy Method of Range Class failed", and
- An error regarding disconnections.
I also am noticing something strange, after running the code more than once, I receive changing error messages and am not sure if there is a problem with my version of Excel.
Here is the code I am trying to use:
Dim rng As Range Dim act As Range Set rng = ActiveCell.Rows Set act = Rows("10:10") Range(act).Copy rng.Select rng.Insert Shift:=xlDown