ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Data Validation Error Not Working On Paste Special Values (https://www.excelbanter.com/excel-discussion-misc-queries/450340-data-validation-error-not-working-paste-special-values.html)

Whydidjuly

Data Validation Error Not Working On Paste Special Values
 
Hi,

I have data validation that does not permit text to be written in the cell (Basically Text Length = 0). The range of cells with this validation was renamed "ValidationRange". A macro was created so you cannot paste over the data validation and erase it (http://www.j-walk.com/ss/excel/tips/tip98.htm).

However, it does not work if someone Pastes Special Values. Can someone help me with a VBA code to make this work?

Claus Busch

Data Validation Error Not Working On Paste Special Values
 
Hi,

Am Fri, 19 Sep 2014 18:40:29 +0100 schrieb Whydidjuly:

I have data validation that does not permit text to be written in the
cell (Basically Text Length = 0). The range of cells with this
validation was renamed "ValidationRange". A macro was created so you
cannot paste over the data validation and erase it
(http://www.j-walk.com/ss/excel/tips/tip98.htm).

However, it does not work if someone Pastes Special Values. Can someone
help me with a VBA code to make this work?


you don't need DataValidation.
Try following code. With this code you cannot select a cell into the
range:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("ValidationRange")) Is Nothing Then
Target.Offset(, 1).Select
End If
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional

[email protected]

Data Validation Error Not Working On Paste Special Values
 
Hi I'm interested if you have been able to validate phone numbers using excel. I'm just starting out and would love some ideas or better some working examples. Thanks in advance.


All times are GMT +1. The time now is 08:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com