Add rows via a button on a protected sheet

  • Thread starter DesertRatFloatingInTheOcean
  • Start date
D

DesertRatFloatingInTheOcean

I need some help with two things.

1. I know this is probably a very basic question but any help anyone can
give me would be greatly appreciated. I have a work book that I made for
keeping up with rental costs. I need to be able to have the workbook locked
from formating and deleting formulas. I want to place a button at the top of
all the sheets that will add five rows at a time to the last row. Here's the
other part when it adds the rows they need to have the same formatting and
the updated formulas in them.

Everytime I have tried a macro it doesnt work.

2. This workbook also has a tally sheet with all the names of our vendors
and their running totals for each and a grand total for all. I need another
button to add a new sheet that is a blank of the rental sheet. And at the
same time update the tally sheet with the new sheets name and total amount
and update the the formula I have to add the grand total.

I hope that makes sense and someone can help.

Thanks
 
P

Per Jessen

Hi

1. Unprotect the sheet, do your stuff and re-protect it.

me.unprotect Password:="JustMe"
'your code
me.protect Password:= "JustMe"

2. I would create a template sheet within the workbook, set up with formulas
and other standard information. Once the template sheet is as desired make
it invisible.
Then insert a new sheet and copy the template to new sheet.
Finally add the new vendor to the tally sheet and adjust formulas.

Hopefully this example will get you started:

Sheets("Template").Visible = False ' Only needed to hide the sheet
"Template"
Set newSh = Sheets.Add(after:=Sheets(Sheets.Count))
NewVendor = InputBox("Enter name of new vendor :")
If NewVendor = "" Then GoTo Finito
newSh.Name = NewVendor
Sheets("Template").Range("A1.H100").Copy Destination:=newSh.Range("A1")
' Insert vendor in tally sheet and adjust formulas

Finito:
Set newSh = Nothing

Regards,
Per

"DesertRatFloatingInTheOcean"
 
D

DesertRatFloatingInTheOcean

Thanks but I dont think I explained it enough;

I know how to add rows and not mess up the spreadsheet. MY COWORKERS DO NOT.
I am trying to make this bullet proof so that when I come off vacation the
spreadsheet is still usable and not trashed.

I need the sheet locked and button at the top of the sheet that will add 5
rows and the formulas at the bottom of the sheet.

the 2nd solutions seems like it will work great.

Thank you very much any more help you might have would be very helpful
 
P

Per Jessen

Hi

To help you further I need more information about how your sheets are
designed.

Is there rows in the bottom obove which new rows are to be inserted, and can
formulas be copied from the row above. Or can new rows be inserted in first
empty row?

In which cells / columns is data entry allowed ?

Regards,
Per

"DesertRatFloatingInTheOcean"
 

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