View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Choose which cell to paste data

Type:=8 will allow you to use the mouse:

Sub movem()
Dim r1 As Range, r2 As Range
Set r1 = Selection
Set r2 = Application.InputBox(prompt:="pick destination", Type:=8)
r1.Copy r2
End Sub
--
Gary''s Student - gsnu201002


"Mik" wrote:

Using VBA, I have copied the contents / comments / color etc.. of a
particular cell (single or merged), and wish to manually select (using
mouse pointer) which cell to paste the data.

So, I guess the VBA code should pause / stop until a new cell is
chosen and confirmed.
Is this posible?

My code so far is....

Private Sub CommandButton4_Click()
' MOVE data
Dim Answer As String
Dim MyNote As String
MyNote = "Move selected data?"
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "For Confirmation")
If Answer = vbNo Then
Exit Sub
End If
Selection.Copy
With ActiveCell
.Interior.ColorIndex = xlNone
.ClearContents
.ClearComments
.UnMerge
End With
MsgBox ("Please select new cell, where data will be copied to. ")

?????????????

ActiveSheet.Paste
End Sub

Thanks in advance.
Mik
.