how to copy a sheet to diferent workbook. no paste
With your help finally I got it rite:
Sub macro1() ' Moving Data Macro' Workbooks.Open Filename:= "C:\MYLOCATION\Source.csv" ActiveWindow.Visible = False Windows("Source.csv").Visible = True Range("A1:G1500").Copy (Workbooks("Destination.xls").Sheets("Sheet2").Ran ge("A1:G1500")) Workbooks("Source.csv").Close SaveChanges:=False Windows("Destination.xls").Activate Sheet2.Select Columns("A:G").EntireColumn.AutoFit End Sub My 2003 Excel didnt like me to use := to specify the destination. () after copy was good enough. Thanks again Jim "Jim Jackson" wrote: You can use: Wbk1.Activate Sheets("datasource").Activate Range("A1:B50").Select ThisWorkbook.ActiveSheet.Range("C" & rnum) = Selection -- Best wishes, Jim "aidan" wrote: I want to copy a range from one workbook to a different one without useing paste |
how to copy a sheet to diferent workbook. no paste
Glad I could help.
-- Best wishes, Jim "aidan" wrote: With your help finally I got it rite: Sub macro1() ' Moving Data Macro' Workbooks.Open Filename:= "C:\MYLOCATION\Source.csv" ActiveWindow.Visible = False Windows("Source.csv").Visible = True Range("A1:G1500").Copy (Workbooks("Destination.xls").Sheets("Sheet2").Ran ge("A1:G1500")) Workbooks("Source.csv").Close SaveChanges:=False Windows("Destination.xls").Activate Sheet2.Select Columns("A:G").EntireColumn.AutoFit End Sub My 2003 Excel didnt like me to use := to specify the destination. () after copy was good enough. Thanks again Jim "Jim Jackson" wrote: You can use: Wbk1.Activate Sheets("datasource").Activate Range("A1:B50").Select ThisWorkbook.ActiveSheet.Range("C" & rnum) = Selection -- Best wishes, Jim "aidan" wrote: I want to copy a range from one workbook to a different one without useing paste |
All times are GMT +1. The time now is 07:28 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com