ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Button on Form to Add more rows (https://www.excelbanter.com/excel-worksheet-functions/264396-button-form-add-more-rows.html)

Sam

Button on Form to Add more rows
 
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?
--
Susan M.
Project Controls Data Coordinator

Otto Moehrbach[_2_]

Button on Form to Add more rows
 
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

"SaM" wrote in message
...
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?
--
Susan M.
Project Controls Data Coordinator




All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com