View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Urgent - Ctrl-V between sheets, not allow Drag and drop

Maybe you could give them a macro to do the copy|paste.

Option Explicit
Sub copyEm()

Dim rngToCopy As Range
Dim rngToPaste As Range

Set rngToCopy = Nothing
On Error Resume Next
Set rngToCopy = Application.InputBox(Prompt:="Range to copy", _
Default:=Selection.Address(0, 0), _
Type:=8).Areas(1)
On Error GoTo 0

If rngToCopy Is Nothing Then
Exit Sub
End If

Set rngToPaste = Nothing
On Error Resume Next
Set rngToPaste = Application.InputBox(Prompt:="Top left cell to Paste", _
Type:=8).Cells(1)
On Error GoTo 0

If rngToPaste Is Nothing Then
Exit Sub
End If

rngToCopy.Copy _
Destination:=rngToPaste

End Sub





wrote:

Hi,
I really need to get this working, so please help me if you know a solution.
I want to be able to do Crl-C and Ctrl-V with data between sheets, but I
have a Application.CellDragAndDrop = False within my Worksheet_Activate Sub.

It seems like the celldraganddrop clear the clipboard. Within the sheet, It
is all ok. to make Ctrl-C / -V. But I have to paste between sheets and I
have to not allow celldraganddrop.

Is there a way to keep clipboard content in antother "mode" and pick it up
when needed? Can I use another event to stop Draganddrop? What?? This is how
the sub look now and if I take away CellDragAndDrop line, i can paste from
another sheet as I need. But...

Private Sub Worksheet_Activate()
On Error Resume Next
Application.CellDragAndDrop = False
Application.ScreenUpdating = False
Application.EnableEvents = False
... ...

/Regards


--

Dave Peterson