lock cell1 if cell1 = cell2

Ky1eb88

New Member
Joined
Nov 13, 2013
Messages
14
To be more exact I have a formula set to auto populate cell A2 with data that is entered in cell B1, and cell A3 with cell B2 ect...


I want the cell in column A to lock any time its value is equal to the value in column b on the previous row.


I'm new to VBA and cant work my head around on how to get this to going. I was able to get it to work with single cells, but even replicate that anymore.


Thanks,
Kyle
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
To be more exact I have a formula set to auto populate cell A2 with data that is entered in cell B1, and cell A3 with cell B2 ect...


I want the cell in column A to lock any time its value is equal to the value in column b on the previous row.


I'm new to VBA and cant work my head around on how to get this to going. I was able to get it to work with single cells, but even replicate that anymore.


Thanks,
Kyle
By "lock" do you mean the Excel protection lock or do you mean replace the formula with its immediate value so that future changes to the value owing to a change in data in the B cell that the formula references have no effect??
 
Upvote 0
By "lock" do you mean the Excel protection lock or do you mean replace the formula with its immediate value so that future changes to the value owing to a change in data in the B cell that the formula references have no effect??

I mean cell protection. Cell.lock = true
 
Upvote 0
I mean cell protection. Cell.lock = true

All cells are locked by default unless you specifically unlock them and locking provides no protection unless the worksheet the cells occupy is protected. Is the sheet you want to do this for protected?
 
Upvote 0
All cells are locked by default unless you specifically unlock them and locking provides no protection unless the worksheet the cells occupy is protected. Is the sheet you want to do this for protected?

The sheet is protected I just don't want the cell to be editable when the2 cells equal each other. Sorry I guess I thought that's what.lock did
 
Upvote 0
The sheet is protected I just don't want the cell to be editable when the2 cells equal each other. Sorry I guess I thought that's what.lock did

Unless you unlocked the cell, if the sheet is protected the cell(s) will not be editable by any user who doesn't know and can't guess the password.
 
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,938
Members
449,197
Latest member
k_bs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top