syed_mushraf
Active Member
- Joined
- Oct 13, 2002
- Messages
- 261
How can I save only one worksheet separately from a file which conatains 10 worsheet.
Rgds,
Musharraf
Rgds,
Musharraf
Where should I write this code.On 2002-10-15 23:58, Joe Was wrote:
Sub mySaveSheet()
Dim mySheet
Dim myFile
'The current Workbook.
myFile = ActiveWorkbook.Name
'The current Work-Sheet.
mySheet = ActiveSheet.Name
Sheets(mySheet).Select
'Make a copy of the current Work-Sheet.
Sheets(mySheet).Copy
'Save this Work-Sheet using the Excel "Save-As" dialog screen.
Application.Dialogs(xlDialogSaveAs).Show
'Keep the new file open!
Application.Workbooks(myFile).Activate
End Sub
Hope this helps, it only saves the current sheet in a new file, that you get to place and name. JSW
Sub mySaveSheet()
Dim mySheet
Dim myFile
'The current Workbook.
myFile = ActiveWorkbook.Name
'The current Work-Sheet.
mySheet = ActiveSheet.Name
Sheets(mySheet).Select
'Make a copy of the current Work-Sheet.
Sheets(mySheet).Copy
'Save this Work-Sheet using the Excel "Save-As" dialog screen.
Application.Dialogs(xlDialogSaveAs).Show
'Keep the new file open!
Application.Workbooks(myFile).Activate
End Sub
Hope this helps, it only saves the current sheet in a new file, that you get to place and name. JSW