ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array to copy from one workbook to another (https://www.excelbanter.com/excel-programming/328307-array-copy-one-workbook-another.html)

Delboy

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.

Vasant Nanavati

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" wrote in message
...
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.




Delboy

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" wrote in message
...
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.





Vasant Nanavati

Array to copy from one workbook to another
 
Windows(MasterModel).Activate
Sheets(Sh.Name).Select
Range("D15").Select

etc.

--

Vasant



"Delboy" wrote in message
...
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" wrote in message
...
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.








All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com