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.
|