Run a code in a protected sheet

appz

New Member
Joined
Apr 23, 2012
Messages
10
I am using a drop down box which specifes different amortization frequency. That goes to another page and calculates it.
It worked fine, but now I have to protect the calcuation sheet before I send it out.
This creates issues as now that amortization freq. calc macro does not work. Below is my code.


Sub DropDown706_Change() ' Paydown dropdown
Application.DisplayAlerts = False
Worksheets("Detail").Unprotect Password:="Inve$t1" ' Unprotects the sheet
Worksheets("Detail").Range("A38:I402,Q32:AB44").Locked = False

Dim lngLast_Row As Long
Dim lngRow As Long

lngLast_Row = Worksheets("Detail").Range("B" & Rows.Count).End(xlUp).Row

'Dropdown selections
Select Case Worksheets("Detail").Range("AmortizationPeriodDropDown")

Case "1" ' Monthly Cashflow
Application.DisplayAlerts = False
Worksheets("Detail").Unprotect Password:="Inve$t1" ' Unprotects the sheet
Worksheets("Detail").Range("B38:B398").Value = "" 'Converts the value to null
Worksheets("Detail").Range("B39:B398").FormulaR1C1 = Formual"


Just have inculded one case.
I am trying to unprtoect the Details tab using
Worksheets("Detail").Unprotect Password:="Inve$t1" ' Unprotects the sheet

But some how it does not work.

Appreaciate you help.
Thanks
Appz
 
It goes to selctionchange event of the detail sheet. But I do not have anything there. It is empty.
Sorry
 
Upvote 0
And you continued F8 ALL the way to completion?
Anything else odd happen?

If I've understood right, it works the first time it runs, but errors the 2nd time..
So Go through it once using the F8 (I know it's tedious, but this is troubleshooting).
Then a 2nd time
Basically untill the error occurs.
And see if it ever comes accross a line that reprotects the sheet when it shouldn't..
 
Upvote 0
Thanks jnoma1.
I had issue with my selection drop down box cell was locked.
which was blocking it
Thanks for you time and help

Cheers
Aparna
 
Upvote 0

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