Reduce a range to just be the part within another part?

T

tskogstrom

Hi,
I have a protected sheet with range of cells the user can edit. On the
change event, for each cell in target I restore some formats with a
loop - if it insersect the range of cells allowed.

However, if the user insert a row or column, the code will check all
cells in the column. This is not acceptable, of cource.

However, I want the user to be able to insert rows and columns, so I
can't restrict that together with the sheet protection.

What is the best way to solve this? I don't want to use looping and for
each cell check if it intersect - and if so, Union it to a new range.
Is there any other way?

Happy to all answers,
Regards
tskogstrom
 
G

Guest

Hi ,

May be you can make it done by Unprotect before insert and protect them
again after insert like:

ActiveSheet.Unprotect
Rows(1).insert
ActiveSheet.Protect
 

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