Hi there,
i want to prevent users from pasting more than one column at a time in a sheet.

So I put in the following code.

VB Code:
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2.  
  3.        
  4.     If InStr(1, Target.Address, ":", vbBinaryCompare) Then
  5.         If Sheet1.Range(Target.Address).Columns.Count > 1 Then
  6.             MsgBox "please copy paste one column at at time. our developers are getting tired of this crap"
  7.             Exit Sub
  8.         End If
  9.     End If
  10. End Sub

However the trouble with this is that it doesn't allow me to select multiple columns from the sheet.

How do I distinguish between pasting and selecting?


Cheers,
Abhijit