I have a protected sheet where the user can input in certain cells only.
I would like VBA that will look for the text "other" in C15:D36, and if any of those cells contain any part of the word "other", I want it to unlock the Total Miles cell in that particular row. For example: if C15 OR D15 has any part of the text "other", I want code to unlock H15 so the user can input the total miles (overwriting the formula in that cell). I found some code (see below) that I edited but not working as I expected. I can't get 1 row to work let alone 22 rows. Please help. (see also the file attached for screen shot) Thank you in advance.
Private Sub CellValueProtect(ByVal Target As Range)
If Active.sheet.Range("C15:D15") = "Other" Then
Active.sheet.Range("H15").Locked = False
Else: Active.sheet.Range("H15").Locked = True
End If
If Active.sheet.Range("C16:D16") = "Other" Then
Active.sheet.Range("H16").Locked = False
Else: Active.sheet.Range("H16").Locked = True
End If
If Active.sheet.Range("C17:D17") = "Other" Then
Active.sheet.Range("H17").Locked = False
Else: Active.sheet.Range("H17").Locked = True
End If
If Active.sheet.Range("C18:D18") = "Other" Then
Active.sheet.Range("H18").Locked = False
Else: Active.sheet.Range("H18").Locked = True
End If
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
-Mike Kapnisakis, Warner Bros
With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. You'll also be able to connect with highly specified Experts to get personalized solutions to your troubleshooting & research questions. It’s like crowd-sourced consulting.
We can't always guarantee that the perfect solution to your specific problem will be waiting for you. If you ask your own question - our Certified Experts will team up with you to help you get the answers you need.
Our certified Experts are CTOs, CISOs, and Technical Architects who answer questions, write articles, and produce videos on Experts Exchange. 99% of them have full time tech jobs - they volunteer their time to help other people in the technology industry learn and succeed.
We can't guarantee quick solutions - Experts Exchange isn't a help desk. We're a community of IT professionals committed to sharing knowledge. Our experts volunteer their time to help other people in the technology industry learn and succeed.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.