Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copy to another workbook - prompt for input

I'd start the macro on the sheet that gets the values.

Option Explicit
Sub CopyTargetSheet()

Dim RngToCopy as range
Dim DestCell as range

with workbooks("BRAZIL Data Upload.xls").worksheets("BRAZIL Actuals")
set rngtocopy = .range("D4:o9")
end with

with activesheet
set destcell = .range("d4")
end with

rngtocopy.copy
destcell.pasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

End Sub

Untested, uncompiled. Watch for typos.

And that "Sending" workbook still has to be opened.

JenL wrote:

Hello,

I have the below macro which copies several ranges from one workbook to
another that works great. I want to duplicate this for another purpose.
However my destination workbook that will have the data pasted into it is
named something different every week. The columns/cells are always in the
same place, but the date is put on the end of the file name each week. So
how do I modify this macro so it will prompt me and ask which file to paste
into when it runs?

THANKS!

Sub CopyTargetSheet()

Windows("BRAZIL Data Upload.xls").Activate
Sheets("BRAZIL Actuals").Activate
Range("D4:O9").Select
Selection.Copy
Windows("2008 Target Sheet.xls").Activate
Sheets("BRAZIL Actuals").Activate
Range("D4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


--

Dave Peterson
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
Prompt user for input Jerry Foley Excel Programming 2 April 13th 07 08:46 PM
Prompt user for input and utilize that input ninner Excel Worksheet Functions 2 March 28th 07 09:44 PM
Having a Macro Prompt Me For Input carl Excel Worksheet Functions 3 January 13th 06 02:24 PM
Copy cell data from workbook based on user input Michael A Excel Programming 7 December 31st 05 03:07 PM
Copy cells into another workbook with an input box to select the file scottdepauw Excel Programming 0 November 19th 04 07:25 PM


All times are GMT +1. The time now is 08:56 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"