|
-
Jun 27th, 2006, 02:13 AM
#1
Thread Starter
Lively Member
Copying to a new workbook??
Hi
I'm running a macro that sorts, filters and formats some source data - until now my results have shown in the same workbook as the macro is running from, but I've found it more handy (and a lot of harddrive space saving), if my results appeared in a new workbook.
I used the macro recorder to try to get a clue of what to do, but it only gave me more questions;
I'm using a commandbutton to execute the code. The first time it is run it should generate a new workbook and paste the results in there, however the second time it is run it shouldn't create a new workbook (since it has already been created), but merely copy the results into two new sheets. Something like;
VB Code:
if not workbook("book1") exists then
workbook.add
'code
else
'code
end if
any ideas? bet there is a dead easy solution
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
|