Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function triggering a macro Leon Excel Worksheet Functions 1 December 22nd 05 07:26 AM
Daily Macro Triggering JB2010 Excel Discussion (Misc queries) 2 November 2nd 05 04:28 PM
hyperlink function verification Mike Dickey Excel Programming 2 February 18th 04 08:51 PM
Triggering Macro Execution Peter M[_3_] Excel Programming 1 January 12th 04 08:20 PM
triggering different macros from list box? hammer Excel Programming 9 October 14th 03 10:37 PM


All times are GMT +1. The time now is 02:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"