View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Copy to another workbook - prompt for input

Hi,

Just a little more info will help.
Do you want the macro to create the new workbook or does the workbook
already exist? If already exists, do you want the user to Browse for it?

If you want the macro to create it, in what format do you want the date
appended to the new workbook name? For example. NewBook yyyy-mm-dd or NewBook
mm-dd-yyyy. I like the first format because they sort well.

What about the folder/directory of the new workbook? Will it in the same
location as the one that contains the macro or maybe a sub folder of the
current folder.


--
Regards,

OssieMac


"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