PDA

View Full Version : Solved: Save Active Worksheet



mpewsey
11-17-2005, 04:13 AM
This is probably a very simple one but it's got me stumped!

I've got a workbook which contains a number of sheets. All I want to do is create a new workbook with just one of the sheets in it (it'll be the active sheet) and save this to a specified location.

I thought it would be easy to do with VBA but I just can't think how to do it.

Thanks for your assistance

Martin

Killian
11-17-2005, 05:23 AM
You're right, it is simple :whistle: but,to be fair, not exactly obvious...
When you use Copy on a worksheet with no paramaters (to tell it where), it copies to a new workbook.ActiveSheet.Copy
The new workbook will then be the active one and you can go on to use .SaveAs with a path or show the Save As... dialog

Bob Phillips
11-17-2005, 05:25 AM
This is probably a very simple one but it's got me stumped!

I've got a workbook which contains a number of sheets. All I want to do is create a new workbook with just one of the sheets in it (it'll be the active sheet) and save this to a specified location.

I thought it would be easy to do with VBA but I just can't think how to do it.

Thanks for your assistance

Martin


Activesheet.Copy
ACtiveworkbook.SaveAs filename:="soomething"

mpewsey
11-17-2005, 06:00 AM
Many thanks for your help:thumb