We help IT Professionals succeed at work.
Get Started

Excel VBA Query

DHPBilcare
DHPBilcare asked
on
235 Views
Last Modified: 2012-05-11
We have a spread sheet in which after a cell has had data entered into it the cell is protected and a password is required to make any further changes.

This is achieved by the following Macro.

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim cell As Object
    For Each cell In Target.Cells
            ActiveSheet.Unprotect "qaupdate"
            cell.Locked = True
            ActiveSheet.Protect "qaupdate", DrawingObjects:=True, Contents:=True, Scenarios:=True _
        , AllowFormattingColumns:=True, AllowFormattingRows:=True
    Next cell
End Sub

This locking by cell is proving too restrictive on the normal data user and they have asked if there is a way to lock down by Row.  i.e. as soon as you go to another line the line that was in use locks for normal use, which allows the initial entry to be corrected by the original person if they spot an error in a cell prior to completing the entire line.

Hope this makes sense.  How could this be accomplished?
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 2 Answers and 2 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE