• 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.

Unlock cells by filling other cells only

nmktadi

New Member
Hi

I am doing a worksheet that allows users to fill in certain cells, I need the user to be filling in cells only when a previous cell has been entered.

B2 is unlocked and is first cell to fill in
b3 will only unlock if b2 is not blank

I figure this out by using this
upload_2015-6-25_1-47-16.png

but cant figure our how to repeat this when b3 is fill out to unlock b4

and after filling b4 to unlock range b7:c38

if i repeat the Sub b4 remains locked
upload_2015-6-25_1-48-43.png

just started using Macros and I am quite lost
appreciate all help that can be provided
 
Hi nmktadi!

Your second macro should work. Perhaps it's not firing because of the name of it? (Worksheet_Calculate2). Try putting your code to unlock B4 in the same sub where your code to unlock B3 is.

You can use the same structure to lock/unlock your B7:C38 range.

However, a few notes:
- Try to switch your password to a string variable. If you ever want to change it, it'll be 100x easier.
- Try getting used to the habit of referring your worksheet: Thisworkbook.Worksheets("Sheet1").Range("B3") , or using variables:
dim sheetlock as worksheet
set sheetlock = Thisworkbook.Worksheets("Sheet1")
sheetlock.Range("B3") .....

If you keep writing VBA code, it'll become mandatory.
 
Back
Top