+ Reply to Thread
Results 1 to 4 of 4

Array to copy from one workbook to another

  1. #1
    Delboy
    Guest

    Array to copy from one workbook to another

    Hi,

    I have an array (and For next loop) which copies specified (by me) named
    sheets from a user selected workbook. The bit that I can't get to work is
    how do I select the same named sheets from the original array in the "master"
    workbook to receive the paste? They need to be selected individually as
    there are a series of different ranges being pasted etc. Help.

  2. #2
    Vasant Nanavati
    Guest

    Re: Array to copy from one workbook to another

    You may get some helpful answers if you post some of the relevant code and a
    clearer explanation.

    --

    Vasant

    "Delboy" <Delboy@discussions.microsoft.com> wrote in message
    news:5541A90F-AF8C-4723-A899-9E70D27FCB19@microsoft.com...
    > Hi,
    >
    > I have an array (and For next loop) which copies specified (by me) named
    > sheets from a user selected workbook. The bit that I can't get to work is
    > how do I select the same named sheets from the original array in the

    "master"
    > workbook to receive the paste? They need to be selected individually as
    > there are a series of different ranges being pasted etc. Help.




  3. #3
    Delboy
    Guest

    Re: Array to copy from one workbook to another

    Ok here is an exerpt of my code. The first bit works, its the bit when it
    selects the "MasterModel" that I need help with. It needs to select the same
    sheet in the MasterModel as it has just copied from the "UserModel".

    Dim Sh As Worksheet

    MasterModel = ActiveWorkbook.Name

    [Various other code]

    UserModel = ActiveWorkBook.Name

    For Each Sh In Sheets(Array("SheetA", "SheetB", "SheetC", "SheetD",
    "SheetE", "SheetF"))

    StartRng = Range("A10")
    EndRng = Range("A8") - 1

    FirstRange = "D" & StartRng & ":" & "D" & EndRng
    Range(FirstRange).Select
    Selection.Copy

    Windows(MasterModel).Activate

    [How do I select the same sheet as the array to paste the data in eg, first
    SheetA, then Sheet B etc]

    Range("D15").Select
    Selection.PasteSpecial xlPasteValues

    Windows(UserModel).Activate
    FirstRange = "I" & StartRng & ":" & "AW" & EndRng
    Range(FirstRange).Select
    Selection.Copy

    Windows(MasterModel).Activate

    [How do I select the same sheet as the array to paste the data in eg, first
    SheetA, then Sheet B etc]

    Next Sh

    "Vasant Nanavati" wrote:

    > You may get some helpful answers if you post some of the relevant code and a
    > clearer explanation.
    >
    > --
    >
    > Vasant
    >
    > "Delboy" <Delboy@discussions.microsoft.com> wrote in message
    > news:5541A90F-AF8C-4723-A899-9E70D27FCB19@microsoft.com...
    > > Hi,
    > >
    > > I have an array (and For next loop) which copies specified (by me) named
    > > sheets from a user selected workbook. The bit that I can't get to work is
    > > how do I select the same named sheets from the original array in the

    > "master"
    > > workbook to receive the paste? They need to be selected individually as
    > > there are a series of different ranges being pasted etc. Help.

    >
    >
    >


  4. #4
    Vasant Nanavati
    Guest

    Re: Array to copy from one workbook to another

    Windows(MasterModel).Activate
    Sheets(Sh.Name).Select
    Range("D15").Select

    etc.

    --

    Vasant



    "Delboy" <Delboy@discussions.microsoft.com> wrote in message
    news:8A2BE3F3-E535-475D-B13C-97842596AA80@microsoft.com...
    > Ok here is an exerpt of my code. The first bit works, its the bit when it
    > selects the "MasterModel" that I need help with. It needs to select the

    same
    > sheet in the MasterModel as it has just copied from the "UserModel".
    >
    > Dim Sh As Worksheet
    >
    > MasterModel = ActiveWorkbook.Name
    >
    > [Various other code]
    >
    > UserModel = ActiveWorkBook.Name
    >
    > For Each Sh In Sheets(Array("SheetA", "SheetB", "SheetC", "SheetD",
    > "SheetE", "SheetF"))
    >
    > StartRng = Range("A10")
    > EndRng = Range("A8") - 1
    >
    > FirstRange = "D" & StartRng & ":" & "D" & EndRng
    > Range(FirstRange).Select
    > Selection.Copy
    >
    > Windows(MasterModel).Activate
    >
    > [How do I select the same sheet as the array to paste the data in eg,

    first
    > SheetA, then Sheet B etc]
    >
    > Range("D15").Select
    > Selection.PasteSpecial xlPasteValues
    >
    > Windows(UserModel).Activate
    > FirstRange = "I" & StartRng & ":" & "AW" & EndRng
    > Range(FirstRange).Select
    > Selection.Copy
    >
    > Windows(MasterModel).Activate
    >
    > [How do I select the same sheet as the array to paste the data in eg,

    first
    > SheetA, then Sheet B etc]
    >
    > Next Sh
    >
    > "Vasant Nanavati" wrote:
    >
    > > You may get some helpful answers if you post some of the relevant code

    and a
    > > clearer explanation.
    > >
    > > --
    > >
    > > Vasant
    > >
    > > "Delboy" <Delboy@discussions.microsoft.com> wrote in message
    > > news:5541A90F-AF8C-4723-A899-9E70D27FCB19@microsoft.com...
    > > > Hi,
    > > >
    > > > I have an array (and For next loop) which copies specified (by me)

    named
    > > > sheets from a user selected workbook. The bit that I can't get to

    work is
    > > > how do I select the same named sheets from the original array in the

    > > "master"
    > > > workbook to receive the paste? They need to be selected individually

    as
    > > > there are a series of different ranges being pasted etc. Help.

    > >
    > >
    > >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1