Activate a macro to insert a row and copy the formuals from the rows above to the blank row

  • Thread starter Thread starter oil_driller
  • Start date Start date
O

oil_driller

This macro works fine doing it this way. The problem is when I try to
protect the worksheet, and activate the macro to insert a row and copy the
formulas from above to the blank row I get a "runtime error 1004" and it
does not copy the formulas from the rows above to the inserted ( blank )
row. Anyone have any suggestions as what to do? I am using Excel 2002.

Thanks,

Charlie
 
Excel will not allow you nor the code to insert a new row if the sheet is
protected. What you have to do is include code in your macro to unprotect
the sheet at the start of your macro and protect the sheet at the end of
your macro. The commands are:
Worksheet("TheSheetName").Protect
Worksheet("TheSheetName").UnProtect
HTH Otto
 

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

Back
Top