Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Paste Function in Macro

Hi,
I'm setting up a macro that copies information from one
tab in a workbook, and needs to paste it to another tab.
The problem is, I need to set it up so that a pop up
appears asking what cell to paste the data to. Ex:

Copies cells A1

Asks "Where do you want the info?"

User types "C5"

Macro pastes the data to C5.

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Paste Function in Macro

Dim sh as worksheet
Dim rng as Range
set sh = Activesheet
On Error Resume next
set rng = Application.InputBox("Where do you want the info (select with
mouse or type in)",type:=8)
On Error goto 0
if not rng is nothing then
sh.Range("A1").Copy Destination:=rng
End Sub

--
Regards,
Tom Ogilvy


"Kate" wrote in message
...
Hi,
I'm setting up a macro that copies information from one
tab in a workbook, and needs to paste it to another tab.
The problem is, I need to set it up so that a pop up
appears asking what cell to paste the data to. Ex:

Copies cells A1

Asks "Where do you want the info?"

User types "C5"

Macro pastes the data to C5.

Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Paste Function in Macro

Kate,

Use Application.Inputbox with a type of 8. Your user can then select a cell,
using the mouse.For example

Set ans = Application.InputBox("Select a cell", Type:=8)
Msgbox ans.Value

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Kate" wrote in message
...
Hi,
I'm setting up a macro that copies information from one
tab in a workbook, and needs to paste it to another tab.
The problem is, I need to set it up so that a pop up
appears asking what cell to paste the data to. Ex:

Copies cells A1

Asks "Where do you want the info?"

User types "C5"

Macro pastes the data to C5.

Any ideas?



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
Cut and Paste macro David T Excel Discussion (Misc queries) 2 September 23rd 09 10:04 PM
run macro after paste K Excel Worksheet Functions 3 October 28th 08 09:06 AM
Macro paste Sue Excel Discussion (Misc queries) 0 October 7th 08 05:30 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 06:23 AM.

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

About Us

"It's about Microsoft Excel"