Unintended effect VBA code for drag and drop
Hi,
I am working on making an excel spreadsheets for my colleagues to fill in, not that they are not Excel savvy. The issue with my spreadsheet is that:
1. it has many lines with formulas/equations, and if the user would drag and drop any of the cells they are allowed to edit, they will brick the references of the formulas.2. also, the cells they are allowed to edit are “data validation” cells, meaning that the data validation will be removed if they drag and drop the cell.
So, I thought it would be best to block the drag and drop function. I am doing it with the following VBA codes :
————————————
Private Sub Workbook_Activate()
Application.CellDragAndDrop = False
End Sub
———————————–
Private Sub Workbook_close()
Application.CellDragAndDrop = True
End Sub
———————————–
The issue here is that. I can only copy data from my spreadsheet to other spreadsheets, and not the other way around. I have asked several people (and Chatgpt, of course). But there seems to be no easy fix for this issue. It is crucial for the people filling in this spreadsheet to copy data from other spreadsheets to the one that I am sending them.
So, any help regarding this issue would be super appreciated!
Best regards,
Aram
Hi, I am working on making an excel spreadsheets for my colleagues to fill in, not that they are not Excel savvy. The issue with my spreadsheet is that:1. it has many lines with formulas/equations, and if the user would drag and drop any of the cells they are allowed to edit, they will brick the references of the formulas.2. also, the cells they are allowed to edit are “data validation” cells, meaning that the data validation will be removed if they drag and drop the cell. So, I thought it would be best to block the drag and drop function. I am doing it with the following VBA codes : ————————————Private Sub Workbook_Activate()Application.CellDragAndDrop = FalseEnd Sub———————————–Private Sub Workbook_close()Application.CellDragAndDrop = TrueEnd Sub———————————– The issue here is that. I can only copy data from my spreadsheet to other spreadsheets, and not the other way around. I have asked several people (and Chatgpt, of course). But there seems to be no easy fix for this issue. It is crucial for the people filling in this spreadsheet to copy data from other spreadsheets to the one that I am sending them. So, any help regarding this issue would be super appreciated! Best regards,Aram Read More