Only allow 1 cell in range to be populated

brumby

Active Member
Joined
Apr 1, 2003
Messages
400
Hiya,

I am using datavalidation in a range "a3:a70" to only allow a "*" to be entered, this is a selection method to return a series of data in another part of the sheet.

Is is possible if the user enters a * in that range, the rest of the range is cleared, meaning only 1 entry will ever be made?

So........in previous saved version, cell a9 had the *.

User opens workbook and selects a45, this triggers a clear from A3:a70, leaving only a45 with *.


Many Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Can you do it with a Change Event as below:-
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Rng As Range
Set Rng = Range("A3:A70")
If Not Intersect(Target, Rng) Is Nothing Then
    Rng.ClearContents: Target = "*"
End If
End Sub
 
Upvote 0
superb, thats great, is it possible to only have that range as selectable area? eg rest of sheet not "clickable'
 
Upvote 0

Forum statistics

Threads
1,224,749
Messages
6,180,725
Members
452,995
Latest member
isldboy

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