Macro not working when protecting sheet

stenmark

New Member
Joined
Mar 15, 2005
Messages
23
Hi

-------------
Rows("22").Select
Selection.EntireRow.Hidden = False
Range("A1:C1").Select
-------------

Working fine until I protect the sheet...
Excel gives error message saying "property hidden cant be used for class range"....anyone know how to get around this?

Thanks in advace
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi, stenmark,

try something like this
Code:
ActiveSheet.Unprotect
Rows("22").EntireRow.Hidden = False
Range("A1:C1").Select
ActiveSheet.Protect
depending on your version there is a setting to allow "row-edits", when you protect a worksheet, but you don't seem to have Excel 2002 or higher (I think it was not there in 2000)

attention:
you don't have to select the row to edit it (see code without select)
kind regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,871
Members
449,054
Latest member
juliecooper255

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