From: Nev on 1 Mar 2010 16:12 H Guys can you help. i want to copy a sheet from a closed book into an open book via vba macro. Example is - run code to open the workbook, copy the only worksheet in that book and paste it into an existing sheet in a workbook that is already open. Can u help Thanks Nev
From: JLGWhiz on 1 Mar 2010 19:37 You left a lot of unanswered questions so I took some liberties. You will have to change the name "Somefile" to the actual workbook name that you want to copy from. Sub cpySht() Dim wb1 As Workbook, wb2 As Workbook Set wb1 = ActiveWorkbook myPath = wb1.Path fName= myPath & "Somefile.xls" <<<Sustitute actual wb name Worbooks.Open fName Set wb2 = ActiveWorkbook wb2.Sheets(1).Cells.Copy wb1.Sheets(Sheets.Count).Range("A1") Application.CutCopyMode = False End Sub "Nev" <Nev(a)discussions.microsoft.com> wrote in message news:963A660E-6B42-4D37-BE2F-B6342BC3D657(a)microsoft.com... >H Guys > > can you help. i want to copy a sheet from a closed book into an open book > via vba macro. > Example is - run code to open the workbook, copy the only worksheet in > that > book and paste it into an existing sheet in a workbook that is already > open. > > Can u help > > Thanks > > Nev
|
Pages: 1 Prev: Macro to change pivot field with latest value Next: Parse only text from column? |