disallow selection of a cell

apgmin

Board Regular
Joined
Mar 1, 2010
Messages
137
Office Version
  1. 2013
Platform
  1. Windows
Please help!
Suppose there a 2 cells
A1 & B1

now I want a person should not be allowed to input any data in cell B1 unless he first input a data in cell A1

how do I do that

thanks for improving my excel
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
One way
Code:
Private Sub worksheet_selectionChange(ByVal target As Range)
If Range("A1").Value <> "" Then Exit Sub
Range("A1").Select
End Sub
 
Upvote 0
thanks
could you please advice how to use the code

Sorry to bother you
 
Upvote 0
Right click on the sheet Tab and select View Code.
Paste the code where the cursor is flashing in the Right hand window
 
Upvote 0

Forum statistics

Threads
1,206,762
Messages
6,074,788
Members
446,088
Latest member
Koustubh12

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