PC Review


Reply
Thread Tools Rate Thread

Data Validation - Do not want to allow pasting into the cell

 
 
MFTiger
Guest
Posts: n/a
 
      19th Nov 2008
How can a cell with a data validation drop down box not allow users to paste
into the cell. When they paste, it allows values not in the drop-down list.
However the user cannot free-type into the cell anything not in the drop-down
list.
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      19th Nov 2008
Hi,

That's a shortcoming of data validation that you will have to live with, no
workaround AFAIK.


Mike

"MFTiger" wrote:

> How can a cell with a data validation drop down box not allow users to paste
> into the cell. When they paste, it allows values not in the drop-down list.
> However the user cannot free-type into the cell anything not in the drop-down
> list.

 
Reply With Quote
 
NOPIK
Guest
Posts: n/a
 
      19th Nov 2008
On Nov 19, 8:41*pm, MFTiger <MFTi...@discussions.microsoft.com> wrote:

probably, box itself is limited to the list
 
Reply With Quote
 
john
Guest
Posts: n/a
 
      19th Nov 2008
If you are happy to use a macro you may be able to use Worksheet_Change event
to test user input.

Following code not tested but something along these lines may do what you
want:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim Found As Range

With Target
'row / col of validation list
'change as required
If .Column = 6 And .Row = 7 And .Value <> "" Then

'list range
'change as required
Set rng = Range("C7:C12")

Set Found = rng.Find(Target.Value)

If Found Is Nothing Then

MsgBox "Input Not Valid"

With .Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:="=$C$7:$C$12" 'change as
required
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = "Input Not Valid"
.ShowInput = True
.ShowError = True
End With
.ClearContents
End If
End If
End With
End Sub

it's a bit messy perhaps others may be able to offer a cleaner solution.
--
jb


"MFTiger" wrote:

> How can a cell with a data validation drop down box not allow users to paste
> into the cell. When they paste, it allows values not in the drop-down list.
> However the user cannot free-type into the cell anything not in the drop-down
> list.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data validation vs. cutting pasting =?Utf-8?B?SWxseWEgVGVpZGVtYW4=?= Microsoft Excel Misc 0 22nd Aug 2007 12:32 PM
Data validation doesn't work if contents is added by pasting jeff.taylor@virgin.net Microsoft Excel Discussion 1 5th Nov 2006 09:25 PM
Pasting restricted data in cells with validation =?Utf-8?B?SXNpdG8=?= Microsoft Excel Crashes 0 22nd Sep 2006 03:40 PM
Why does data validation not work when pasting data into a cell. =?Utf-8?B?cmpzaGVsYnk=?= Microsoft Excel Misc 1 31st Jul 2006 09:08 PM
When pasting data into a column with data validation I lose validation check Brad Microsoft Excel Misc 5 17th Apr 2004 01:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:33 AM.