Hi everyone,
Recently I built a spreadsheet for another department for the collection of data. This is a stop gap measure while the online module is built. This department then sends this worksheet to their sub departments to complete. We also built a simple Access database to collate the data and create simple reports once returned.
To keep the data integrity levels high I used VB code and validation rules (I found these in forums like this one). These disable right clicks, cut and paste functions and disallows any blank cells. For repeated data I put in drop down menus.
It worked perfectly, and initially they were pretty wrapped. But now the sub departments have complained that they can’t cut and paste large amounts of data into item description columns and it’s too hard to type it in one cell at a time...If I had my way I’d tell the sub department to suck it up, but in the interests of inter departmental relations I obviously can’t.
So the department wants the macro to allow the pasting of data, but only in one single column and only in a selected cell range of the worksheet - in this case column ‘A’ cell range ‘20:325’). The problem is I don’t know if this is possible and really require your advice on the issue.
I have included the macro I currently use below.
If anyone can help me I would really appreciate it.
-------
Private Sub Workbook_Activate()
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_Deactivate()
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Cancel = True
MsgBox "Right click menu deactivated." & vbCrLf & _
"Cannot copy or ''drag & drop''.", 16, "For this workbook:"
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.CutCopyMode = False
End Sub
Bookmarks