Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to enable Copy and Paste when the sheet and workbook is protected | Excel Discussion (Misc queries) | |||
Compare two Worksheet and copy the diferent rows to other | Excel Discussion (Misc queries) | |||
Copy and paste data from one sheet to another in a single workbook | Excel Programming | |||
I cannot paste from one workbook to another. Copy works, paste do. | Excel Discussion (Misc queries) | |||
automatic copy and paste from sheet to sheet in a workbook | Excel Programming |