Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50125

Insert rows before signature

$
0
0
Hello all,

I have a worksheet that is protected with password as there is several formulas in it. A macro was created to allow users to add rows to the end of the data table.

However now i need to insert a signature box within the same worksheet but below the data table, which means the macro will now only insert rows below the signature box instead. Is there a way i can only insert rows below the data table? thanks!

the macro i have now is like this:

Private Sub AddRows()
'
' AddRows Macro
'
ActiveSheet.Unprotect Password:="123"
r = ActiveSheet.Cells.Find(What:="*", SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row + 1
Rows(30).Copy
Rows(r).Insert
Rows(r).SpecialCells(xlConstants).ClearContents
ActiveSheet.Protect Password:="123", DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowInsertingRows:=True, AllowDeletingRows:=True, AllowSorting:=True, _
AllowFiltering:=True, AllowUsingPivotTables:=True
End Sub

Viewing all articles
Browse latest Browse all 50125

Trending Articles