Insert Copied Rows in protected Sheet. Help

HiSoC8Y

New Member
Joined
Jul 2, 2005
Messages
23
Hi everyone.

I have a worksheet that is protected, and i have given the user to insert rows. The user can insert rows, that works. However, if i copy a complete row and try to insert it, it doesnt allow me. I need to do so, because i have formulas in that row which i want it to be copied also.


So what can the solution be?

Thanks, and this is a great place for excel knowledge.
 
Erik,
I am new to <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym> coding so I just simply copy and paste above code and it works. But it works only when you run the macro.
Is it possible that the same code auto-runs when you click on Paste.
Please advise. Thank you.

this is the basic macro to start
Code:
Sub test()
ActiveSheet.Unprotect "password"
With ActiveCell
.EntireRow.Copy
.Insert Shift:=xlDown
End With
Application.CutCopyMode = False
ActiveSheet.Protect "password"
End Sub
you will probably have some requirements ...

first do some tests please
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top