Need To Lock Cell Range Based On Cell Value

shoey88

New Member
Joined
Sep 11, 2012
Messages
6
Hi,

I am hoping someone can help me otherwise I may cry,

I have a spreadsheet that has number between 1-20 entered in every cell in column B all the way down to row 15,000

I need to program something in VBA that will look at each number and then lock a certain range in that row based on that value in column B

For example:

In B3 there is the number '5' therefore I would want it to stop the user entering anything between C3 and G3

In B4 there is the number '3' therefore I would want it to stop the user entering anything between C4 and E4

In B12500 there is the number '14' therefore I would want it to stop the user entering anything between C12500 and P12500

I don't want to have to type out programming for each criteria from 1-20 for 15,000 rows!

Please help, much appreciated

Thanks

Jamie
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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