Paste Special Functionality on Cut / Drag and Drop

Copper Contributor

Our app creates an excel which has multiple columns with validations on them eg. what kind of values are allowed and dropdowns for few of them. If user enters something that doesn't fit the validation, cell color changes to intimate that. Issue we have is if user moves the column in excel (either by cut paste or drag and drop), the validations get messed up. It picks the validation of column where it has been moved. When we Copy and use Paste special validations are retained, but we can't expect all the users to do it that way. 

 

And right now I've recorded macros when we try to do these operations and changed the code to match our requirements which was not working as I said earlier. I've tried to mimic the same formula for copy and paste special on cut/drag.

 

 

Sub Macro3()
'
' Macro3 Macro
'

'
    Range("BS2:BS7").Select
    Selection.Cut
    Range("BU2:BU7").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("BU7").Select
End Sub

 

 

 

0 Replies