Locked Sheets and Hiding Rows

Newbienew

Active Member
Joined
Mar 17, 2017
Messages
376
Office Version
  1. 2016
Platform
  1. Windows
I am having an issue with my sheets being locked and using a MACRO transition code to hide and unhide rows by clicking on a circle shape . My Transition code hides and unhides rows 16-17. I would like to still hide and unhide these rows even if the sheet is locked. But currently when i lock it, it use the macro button i get an error. Is there anything that i can do or is ther anything that can be done? Thank you for your help in advance
 
Update.
I worked great thank you.


Moreover, another spread sheet has recycled back in my queue. I have already made a posting on it. Would it be advisable to make another posting?
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Oh I m sorry I did do what was suggested when it was posted but i only put this:
Sub transaction1()
ActiveSheet.Unprotect
Rows("16:17").Hidden = Not Rows("16:17").Hidden
ActiveSheet.Protect
End Sub

I did not put the password:="XXXx" on them.
Fair enough. But if you did that, then when you clicked the shape a pop-up box should have appeared on the screen asking for the password. The only way then that you would have arrived at the error message that you reported would have been to 'Cancel' that pop-up box. But you didn't ever report that you were getting a pop-up or that you Cancelled it?

If it did pop-up, and you entered the correct password, the rows should have been hidden/unhidden as required but then the worksheet would have been reprotected without a password meaning that the button would have worked without pop-up from then on.


Update.
I worked great thank you.
Good news. :)


Moreover, another spread sheet has recycled back in my queue. I have already made a posting on it. Would it be advisable to make another posting?
Possibly, but not too often. Refer to #12 of the Forum Rules
 
Upvote 0

Forum statistics

Threads
1,216,102
Messages
6,128,849
Members
449,471
Latest member
lachbee

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