• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Avoid Changes on Non-Empty Cells by user

Bhawani

Member
Hi All,

I am working on a project, where some users update there data but intentionally or unintentionally they are overwriting it.

Now overwriting the data creates mismatch in figures last report and current report.

To avoid this i have attached sample file i am working on, which is perfectly working in below manner
1. Identifies the admin & User (By using Environ Function), for under standing i change my coding in sample file to Sheet-> Data, Range Cell->A1
2. If current user is Admin then allowing to overwrite all cells else
current user is not admin then avoiding to overwrite on yellow columns

Now, problem is this that after selecting 2 or more cells above working fails, please help me out.
 

Attachments

  • Sample File.xlsm
    663.2 KB · Views: 1
Bhawani
Environ("UserName") don't work ... always ... not with me! No matter!
I made some modifications and I tried to left just what really needs .
Would You need something like this?
 

Attachments

  • Sample File (1).xlsm
    640.2 KB · Views: 5
No there is some gap in understanding, actually in uploaded file

Admin in Bhawani Patim (as per coding guidance)
only bhawani patim could only edit in all columns data
user other than bhawani patim is not permissible to edit under red columns
(same is my requirement)
but my requirement fails when other users select more than one cells.
after selection more than one cell user can edit in any cell.

Hope it is clear, i want to avoid user to edit in yellow cell which is working fine but only by single cell editing or overwriting in single cell, it fails on multicells editing.

Please support.
 

Attachments

  • Sample File.xlsm
    664.7 KB · Views: 1
Bhawani
Now, You change Environ("UserName") to Application.UserName,
that works with me,
now 'I cannot' edit yellow nor make multiselection.
What did miss from my previous version?
 

Attachments

  • Sample File (1).xlsm
    638.8 KB · Views: 0
Bhawani
... ooo ... You have added that 'red'-criteria too.
That's okay -
please, next time highlite someway critical changes.
 

Attachments

  • Sample File (1).xlsm
    640.4 KB · Views: 1
@vletm Now in your File user will not be able to even select the red column cell but what i want user cant change it/or over write it.

If you will see in my file you can edit in cell but with same value.

My requirement fails when user re-edit/delete value in more than once cells

Please help guys, i tried my best but unable to reach to end.

Have a look on coding if any loop can work on it.
 
Bhawani
Now You changed criteria again ... hmm?
You wrote:
i want user cant change it/or over write it.
but next You wrote that:
you can edit in cell but with same value.
So, You would like that users
can select
and cannot edit and can edit, but only with same value?
Why let others to select cells if cannot edit ... hmm?
User can edit long time ... and after that
Sorry ... UNDO everything!
This is not for me!
...
Hint: Your 'code' saves ONLY one CELLs VALUE,
that's Your challenge with Your logic!
 
Yes, you are right it will done by something using collection & Array.
But i am unable to do so.
Hope any ninja will have a look on this,
 
Bhawani
... and one more ...
Of course You won't even think to try to Protect sheet or how?
Uneditable cells would be locked and all other unlocked.
If ADMIN uses then UnProtect sheet.
... of course, just one user can use this file same time!
Ps. You wrote something about using Array ...
Do You have any idea how any cells there are in one column?
... and how many columns would You 'take care'?
... many! so many!
 
Last edited:
Back
Top