Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Have a macro that creates a new file. In the new file is a tab called
"Review" which has a macro attached to it. The macro is attempting to copy data from the "review" tab to the "Output" tab in the same workbook. I am running into problems once I select the "output" tab in that VB will not select any cells on the output tab. Instead it provides an error(Application defined or object defined error). Is there a way to overcome this and allow a sheet macro to perform steps on another sheet? Here is an abbreviated version of the macro Sub test() range("A2:a35).select selection.copy Sheets("Output").Select Range("a2").Select 'The error occurs here Activesheet.paste End Sub -- Joe D |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this
Range("A2:A35").Copy Sheets("Output").Range("A2") On Nov 11, 9:13*pm, Joe D wrote: Have a macro that creates a new file. *In the new file is a tab called "Review" which has a macro attached to it. * The macro is attempting to copy data from the "review" tab to the "Output" tab in the same workbook. * I am running into problems once I select the "output" tab in that VB will not select any cells on the output tab. *Instead it provides an error(Application defined or object defined error). * Is there a way to overcome this and allow a sheet macro to perform steps on another sheet? * * Here is an abbreviated version of the macro Sub test() range("A2:a35).select selection.copy Sheets("Output").Select Range("a2").Select * *'The error occurs here Activesheet.paste End Sub -- Joe D |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You dont need to select the sheet to copy. Try the below which copy the range
from active sheet to sheet output Sub Macro() Range("A2:a35").Copy Sheets("Output").Range("a2") End Sub If this post helps click Yes --------------- Jacob Skaria "Joe D" wrote: Have a macro that creates a new file. In the new file is a tab called "Review" which has a macro attached to it. The macro is attempting to copy data from the "review" tab to the "Output" tab in the same workbook. I am running into problems once I select the "output" tab in that VB will not select any cells on the output tab. Instead it provides an error(Application defined or object defined error). Is there a way to overcome this and allow a sheet macro to perform steps on another sheet? Here is an abbreviated version of the macro Sub test() range("A2:a35).select selection.copy Sheets("Output").Select Range("a2").Select 'The error occurs here Activesheet.paste End Sub -- Joe D |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Another way.........
Range("sheet2!a2").Formula = "=sheet1!a2" Range("sheet2!a2").AutoFill Destination:=Range("sheet2!a2:a35") Vaya con Dios, Chuck, CABGx3 "Joe D" wrote: Have a macro that creates a new file. In the new file is a tab called "Review" which has a macro attached to it. The macro is attempting to copy data from the "review" tab to the "Output" tab in the same workbook. I am running into problems once I select the "output" tab in that VB will not select any cells on the output tab. Instead it provides an error(Application defined or object defined error). Is there a way to overcome this and allow a sheet macro to perform steps on another sheet? Here is an abbreviated version of the macro Sub test() range("A2:a35).select selection.copy Sheets("Output").Select Range("a2").Select 'The error occurs here Activesheet.paste End Sub -- Joe D |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How did you attach the macro to a sheet?
Your code runs fine if macro is stored in a general module and run when Review sheet is active. See other posts about "selecting" Gord Dibben MS Excel MVP On Wed, 11 Nov 2009 08:13:02 -0800, Joe D wrote: Have a macro that creates a new file. In the new file is a tab called "Review" which has a macro attached to it. The macro is attempting to copy data from the "review" tab to the "Output" tab in the same workbook. I am running into problems once I select the "output" tab in that VB will not select any cells on the output tab. Instead it provides an error(Application defined or object defined error). Is there a way to overcome this and allow a sheet macro to perform steps on another sheet? Here is an abbreviated version of the macro Sub test() range("A2:a35).select selection.copy Sheets("Output").Select Range("a2").Select 'The error occurs here Activesheet.paste End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sheet name change needed | New Users to Excel | |||
Sheet name needed for formula | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |