L
leonidas
Hi,
In Excel I would like to be able to restrict the places where a use
can insert rows. I have an idea how the macro should work, but I don'
have enough experience to write the code.
The macro should work as follows:
If the activecell is in one of the rows 13:23, 26:30, 32:36, 38:41
43:47, 49, 51:68 then call the macro "InsertCopyRow2" else a messagebo
should appear with the text "You can't insert a row here".
The macro "InsertCopyRow2" is as follows:
Sub InsertCopyRow2()
Application.ScreenUpdating = False
ActiveCell.Offset(1, 0).EntireRow.Insert
ActiveCell.EntireRow.Copy ActiveCell.Offset(1, 0).EntireRow
Selection.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents
End Sub
Can someone help me with this problem? Thanks in advance
In Excel I would like to be able to restrict the places where a use
can insert rows. I have an idea how the macro should work, but I don'
have enough experience to write the code.
The macro should work as follows:
If the activecell is in one of the rows 13:23, 26:30, 32:36, 38:41
43:47, 49, 51:68 then call the macro "InsertCopyRow2" else a messagebo
should appear with the text "You can't insert a row here".
The macro "InsertCopyRow2" is as follows:
Sub InsertCopyRow2()
Application.ScreenUpdating = False
ActiveCell.Offset(1, 0).EntireRow.Insert
ActiveCell.EntireRow.Copy ActiveCell.Offset(1, 0).EntireRow
Selection.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents
End Sub
Can someone help me with this problem? Thanks in advance