Macro-copy
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!
|