Prevent user to drag and drop

C

CVincent

I would like to prevent users to drag and drop data.
Please note that I cannot protect the cells because I
want the user to be able to change the data, but drag and
drop mess up all my references.
Any idea?
 
R

Ron de Bruin

This is a setting in Tools>Options
You can change it with VBA

You can copy this two events in the ThisWorkbook module

Private Sub Workbook_Activate()
Application.CellDragAndDrop = False
End Sub

Private Sub Workbook_Deactivate()
Application.CellDragAndDrop = True
End Sub
 
C

cvincent

Great. Thanks exactly what I needed.
-----Original Message-----
This is a setting in Tools>Options
You can change it with VBA

You can copy this two events in the ThisWorkbook module

Private Sub Workbook_Activate()
Application.CellDragAndDrop = False
End Sub

Private Sub Workbook_Deactivate()
Application.CellDragAndDrop = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl





.
 
Top