Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to write a macro to copy data from one cell, then prompt me for
what cell to paste it in. Please help! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng as Range
On Error Resume Next set rng = Application.InputBox("Select Destination with mouse", type:=8) On Error goto 0 if not rng is nothing then selection.Copy Destination:=rng(1) Else msgbox "You hit cancel" End if -- Regards, Tom Ogilvy "Rusty" wrote in message om... I need to write a macro to copy data from one cell, then prompt me for what cell to paste it in. Please help! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use the Application.InputBox function to return a cell
reference, checking to make sure the Cancel key wasn't selected, viz. Sub PasteMyValue() Dim pasteCell As Range Dim targetCell As Range Set pasteCell = ActiveCell On Error Resume Next Set targetCell = Application.InputBox("Select cell to paste contents", _ "My Paste Function", ActiveCell.Offset(1, 0).Address, , , , , 8) If Not (targetCell Is Nothing) Then 'next 2 lines to paste special pasteCell.Copy targetCell.PasteSpecial xlPasteValues 'or this to paste the cell 'pasteCell.copy targetCell End If End Sub Kevin Beckham -----Original Message----- I need to write a macro to copy data from one cell, then prompt me for what cell to paste it in. Please help! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
need help to update macro to office 2007 macro enabled workbook | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |