Button on Form to Add more rows

S

SaM

I have a form that I have created in excel and in one section of that form, I
want to be able to add a button that will add 5 more rows for that specific
section. The form is protected as there is some pretty heavy formulas and
direct links to databases that update info for the form, so of course users
cannot add rows themselves - is there a way to add a button that will allow
users to add more rows to the form?
 
O

Otto Moehrbach

Susan
Paste this macro into a standard module, then create the button you want
and assign this macro to that button. This macro will unprotect the sheet,
insert the new blank rows, and protect the sheet. Change the row numbers to
fit with your form. Post back if you need more. HTH Otto
Sub InsertRows()
ActiveSheet.Unprotect Password:="Susan"
Rows("12:14").Insert Shift:=xlDown
ActiveSheet.Protect Password:="Susan"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top