Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
oil_driller
 
Posts: n/a
Default Activate a macro to insert a row and copy the formuals from the rows above to the blank row


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


  #2   Report Post  
Otto Moehrbach
 
Posts: n/a
Default

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 a
Worksheet("TheSheetName").Protect
Worksheet("TheSheetName").UnProtect
HTH Otto
"oil_driller" wrote in message
...

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"