Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to copy an image (or picture) from one workbook to a new sheetin another workbook | Excel Worksheet Functions | |||
Excel-how to link source workbook to copy of destination workbook | Excel Worksheet Functions | |||
Copy cells based on conditions in one workbook to another workbook | Excel Worksheet Functions | |||
Copy Array pointer rather than entire array | Excel Programming | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming |