I need a VBA or a non vba to insert rows before the target row in a workbook. Not all sheets will have the same target row. Any ideas? Thanks in advance.
I need a VBA or a non vba to insert rows before the target row in a workbook. Not all sheets will have the same target row. Any ideas? Thanks in advance.
.
Option Explicit Sub AddRow() Dim ws As Worksheet Dim rng As Range '~~> Set this to the relevant worksheet Set ws = ThisWorkbook.ActiveSheet With ws '~~> Set your range Set rng = .Rows(ActiveCell.Row) '~~> Insert the range rng.Offset(0).Insert Shift:=xlDown '<-- NOTE: Change Offset to (1) & xlDown for new row down. '<-- Note: Change Offset to (0) & xlUp for new row up. End With End Sub
Worked perferect!
Thanks!
.
Welcome.