LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Copy to another workbook - prompt for input

Unfortuneatly, it will always be in a different folder. And I do not have
the choice of the name of the file. It is named with mm_dd_yy as the end of
the file name.

I have the below macro working so far. However, I now need it to start on a
different row each time based on user input.

So this time the copy range would be C71:D309
But next week it might be C78:D309

The ending cell and columns will always be the same. The first row is what
I need to prompt for input.

Any suggestions on how to make this better?

Sub CopyCashFlow()
'
' Macro to copy the data input columns from the country files
' to the consolidated LAO cash flow file.
' Macro recorded 2/6/2009 by jlefief
'

Dim strFilename

strFilename = InputBox("Enter the name of the destination file.
Example: Forecast template - LAO_02_06_09.xls", "Enter the name of the
destination file")


Windows("LAO Cash Flow Input Template-ARG.xls").Activate
Sheets("Argentina ARS").Activate
Range("C71:D309").Select
Selection.Copy
Windows(strFilename).Activate
Sheets("Argentina ARS").Activate
Range("C71").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


Application.CutCopyMode = False
ActiveWindow.LargeScroll Down:=1

End Sub



"OssieMac" wrote:

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

 
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
Copy to another workbook - prompt for input Dave Peterson Excel Programming 0 February 6th 09 05:49 PM
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
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 12:37 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"