Hello Experts,
by using below code, i am able to duplicate a selected row and copy it below by removing some of the data in defined areas,
Is it possible to revise the code and do not allow to copy/work/function within range of 1 to 5? as my headers and macro buttons are located within this range.Sub insert_new_item () ActiveCell.EntireRow.Copy ActiveCell.Offset(1, 0).EntireRow.Insert Application.CutCopyMode = False Dim r As Long: r = ActiveCell.Offset(1, 0).Row Cells(r, "I").Resize(, 6).Value = "" Cells(r, "Q").Formula = _ "=IF(OR(P" & r & "="""",P" & r & "=""Insert Date""),"""",IF(P" & r & ">M" & r & ",""Define reason for delay"",""""))" End Sub
lets say, user selects row 4 and when click's on the macro button, error message would popup by telling the user to select table range etc... and macro would not do anything.
appreciate your valued support.
Thanks,
N
Bookmarks