Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default I need help with a macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default I need help with a macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default I need help with a macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 02:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"