Announcement

Collapse
No announcement yet.

open existing workbook to copy sheets into current workbook

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • open existing workbook to copy sheets into current workbook



    Hello,

    I have a workbook and I use as my ever changing database; named "input". With using the following code I'm able to open the workbook.
    Code:
    Workbooks.Open Filename:="Users:machy:desktop:input.xltx"
    What I want to do is have sheet1 in the input workbook be copied to the current workbook.

    I want to do this to allow for continually changing database have updated values in the current workbook.

  • #2


    Re: open existing workbook to copy sheets into current workbook

    Try something like this

    Code:
      Windows("Users:machy:desktop:input.xltx").Activate 'your workbook to get the sheet from
        Sheets("Sheet1").Select ' the sheet you want
        Sheets("Sheet1").Copy Before:=Workbooks("Input.xls").Sheets(1) 'the workbook you want the sheet in
    Last edited by Dave Hawley; April 28th, 2012, 13:56.

    Comment

    Working...
    X