Protection UserInterfaceOnly reading Hidden Formulas

R

Rik Ditter

Can someone please confirm that even with protection
UserInterfaceOnly:=True set for a worksheet, I still
cannot read or use replace method with cells that are set
hidded. I currently have to completely unprotect the
sheet or leave the cells un-hidded... I don't like either
of these options, because the users either see the
formulas or the sheet would be unprotected if the code
pukes...

Anythoughts?!?
-Rik

Read
CellVal = Worksheets("sheet1").Range("U2").Formula
Replace
Worksheets("sheet1").Range("A1:AI164").Replace _
What:="Template", Replacement:=""
 
D

Dave Peterson

If the rows are hidden as a result of an autofilter, then replace won't find
them. The same thing happens when you do it manually.

Maybe you can unfilter, do your change and refilter?

or if the number of cells is small, loop through them and use the replace
function (or application.substitute if you're using xl97).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top