View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Chickering Charles Chickering is offline
external usenet poster
 
Posts: 272
Default Export worksheet only

Tony, Try: Sheets("YourSheet").Copy
by not specifing a location it creates a new workbook, which becomes active.
You can then save the activeworkbook to the name you want or to the sheet
name if you wish:
ActiveWorbook.SaveAs(ActiveSheet.Name,xlNormal)
or you could set the new workbook to a variable if you have other things you
wish to do with it:
Dim wb as Workbook
set wb = ActiveWorkbook
wb.SaveAs....

does that help any?


--
Charles Chickering

"A good example is twice the value of good advice."


"tony wong" wrote:

i only wish to export one of the worksheets only to another excel file.

it seems i can only export the whole workbook and delete other worksheets.

i try to use Worksheets("ABC").Delete but there is popup for yes or no
after.

how can i make it better? Thanks a lot.

tony