|
-
Feb 8th, 2012, 05:26 AM
#4
Re: Help with subscript out of range
Workbooks(WBSource).Sheets(SourceSheet1).Copy Before:=Workbooks(WBTarget).Sheets(Var1)
you need to break this line down to find out which variable is causing the error
i am assuming this is in excel 07?
if the name of your workbooks and sheets are all correct, from the posts in this forum this may have been a common problem with early office 07, fixed with some service pack or other
there are work arounds to avoid the error, but possibly better to get any service packs
your code further down works with sheets, but does not specify which workbook
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|