Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Macro-copy

It's working. I forgot to click yes. Sorry.
And i manage to make this work from a closed workbook from your first post.
Thanks allot!

"Luke M" wrote:

Since you've already got the other workbook open, change code to:


Sub COPY()
MyWorkbook = Format(Date, "dd.mm.yyyy") & ".xls"

Range("B2").Select
Windows(MyWorkbook).Activate
Range("A5:T200").Select
Selection.COPY
Windows("Database.xls").Activate
ActiveSheet.Paste
Range("B2").Select
End Sub

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"puiuluipui" wrote:

Hi Luke. This is my code:
Sub COPY()
Range("B2").Select
Windows("17.09.2009.xls").Activate
Range("A5:T200").Select
Selection.COPY
Windows("Database.xls").Activate
ActiveSheet.Paste
Range("B2").Select
End Sub

I want to copy from "date workbook"(17.09.2009) to Database
Tomorow i will need to copy from "date workbook"(18.09.2009) to Database
.....

Were can i insert your part of the code? I don't know how to do this.
Thanks!

"Luke M" a scris:

Perhaps something like this?

MyWorkBook = "was" & Format(Date, "dd.mm.yyyy")

Workbooks.Open Filename:= _
"C:\Documents and Settings\My Documents\" & MyWorkBook & ".xls"

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"puiuluipui" wrote:

Hi, i need to copy a range from another workbook, but the name of the
workbook is different each day, so i need to copy from a workbook that is
named as dates (Today) yesterday workbook's name was16.09.2009. today
workbook's name is 17.09.2009. I don't want to change macro, so i need to
copy from a workbook with name as Date (Today's date)

Can this be done?
Thanks!

 
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
If macro to copy a row GeorgeA Excel Discussion (Misc queries) 1 June 22nd 09 04:16 PM
Copy workbook, don't copy macro CongroGrey Excel Discussion (Misc queries) 1 June 13th 08 04:56 PM
macro copy Pammy Excel Discussion (Misc queries) 1 April 28th 07 03:48 PM
macro to copy DTruong Excel Discussion (Misc queries) 0 August 4th 06 03:44 PM


All times are GMT +1. The time now is 05:15 PM.

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"