![]() |
Triggering Verification Function
When user use copy and paste to enter some values in the cells, it seem
that copy and paste and bypass the verification function in the cell For example, I added a verification function in a cell and limits use to input numeric data only. However, user can still paste som characters in that cell with no problem. How do I handle this case -- Message posted from http://www.ExcelForum.com |
Triggering Verification Function
Unfortunately, pasting into a cell wipes out its data validation.
-- Vasant "francislee " wrote in message ... When user use copy and paste to enter some values in the cells, it seems that copy and paste and bypass the verification function in the cell. For example, I added a verification function in a cell and limits user to input numeric data only. However, user can still paste some characters in that cell with no problem. How do I handle this case? --- Message posted from http://www.ExcelForum.com/ |
Triggering Verification Function
I just think is it possible to add write some VBA codes in the chang
event of each cell and trigger the cell verfication functio explicitly. Am I correct -- Message posted from http://www.ExcelForum.com |
Triggering Verification Function
Yes, you can
Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range("A1:G2")) Is Nothing Then With Target If IsNumeric(.Value) Then Cells(3, .Column).Value = Cells(1, .Column).Value + _ Cells(2, .Column).Value End If End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "francislee " wrote in message ... I just think is it possible to add write some VBA codes in the change event of each cell and trigger the cell verfication function explicitly. Am I correct? --- Message posted from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 12:11 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com