Copy worksheet to a new workbook using VBA

HeatherO

New Member
Joined
Feb 7, 2005
Messages
20
I am currently working on a report that dumps data into an already set up spreadsheeet, and what I want to do is remove the rows that have no data being sent to it. I've done this and now what I want to do is take this sheet that has the rows only that contain data and copy it to a new workbook that I will create and then what I am going to do is not save the previous workbook that I originally deleted all the rows on since I need this one to do more calculations for a macro and it might dump data into those deleted rows. This is really hard for me to describe. Basically I am just wondering how I can copy a sheet that is active to another new sheet in a totally new workbook, and do I have to create that new workbook before I copy it??
Any help is gratefully appreciated.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
These demos copy a sheet into a new workbook. Demo1 copies active sheet while Demo2 copies Sheet1

Sub demo()
ActiveSheet.Copy
End Sub


Sub demo2()
sheets("Sheet1").Copy
End Sub
 
Upvote 0
Is there anyway though that I can copy the sheet and name the new workbook that it is copying it too?? I wanted to create a new workbook with the name Adv_Sum.xls?
 
Upvote 0
Thanks a billion. That was so simple I think my mind is just starting to numb out I know my back is.
 
Upvote 0

Forum statistics

Threads
1,206,971
Messages
6,075,925
Members
446,170
Latest member
zzzz02

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top