Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to copy a worksheet from workbook "S.xls" and pase it into Worksheet
of Workbook "D.xls" .I am trying to do something like this,also i can't pass Workbook Byref. Sub run_copysheet() Dim Source, Dest As Workbook Set Source = Application.Workbooks.Open("c:\S.xls") Set Dest = Application.Workbooks.Open("c:\D.xls") Call copysheet(Source, "Sheet1", Source, "Sheet1") End Sub Function copysheet(ByVal S1 As Workbook, ByVal SSheetName As String, ByVal D1 As Workbook, ByVal DSheetName As String) S1.Worksheets(SSheetName).Activate Rows("1:30").Select Selection.Copy Set D1 = ActiveWorkbook D1.Worksheets(DSheetName).Activate Cells.Select ActiveSheet.Paste End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy entire contents worksheet into new workbook, link but editabl | Excel Discussion (Misc queries) | |||
how do i copy an entire workbook and paste it in another | New Users to Excel | |||
copy entire row to another workbook | Excel Programming | |||
Copy Data from Workbook into specific Worksheet in other Workbook? | Excel Discussion (Misc queries) | |||
copy worksheet from closed workbook to active workbook using vba | Excel Worksheet Functions |