View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Excel copy after question

Check the following items:

1. If this line does not yet exist in your code, add it before the statment
you posted:

Set bk = ActiveWorkbook 'or Set bk=Workbook(yourworkbookname)

2. Check for extra spaces in your sheet names. I noticed a trailing space
in "Time Balances "... if it's absent in the actual sheet name, you would
receive the 'Object required' response from Excel.

--
Jay


"ll" wrote:

Hi,
I'm very new to the Excel copy after method, and I was wondering how I
would go about integrating the following code into my module. Would I
need to specify the name of the new workbook at some point within the
code? I have tried running the following code by itself in a module,
but I get the "object required" error. Any ideas? Thanks - Louis

==
bk.Worksheets(Array("Hourly Timesheets", "dates", "Time
Balances")).Copy after:=bk.Worksheets(bk.Worksheets.Count)