![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 73
|
how can i save a sheet in my workbook as a separate file using macro???
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Posts: 363
|
Try this:
Sub Save_Sheet() Sheets("Sheet1").Copy ActiveWorkbook.SaveAs FileName:="C:My DocumentsSheet1.xls" End Sub
__________________
It's never too late to learn something new. Ricky |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 73
|
how about saving a range of cells to a new work sheet???
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Ahmedabad Gujarat
Posts: 303
|
Sub saveonesheet()
Dim sht As Worksheet Dim strshtname As String Application.DisplayAlerts = False strshtname = InputBox("Give the Name of the Sheet You Want to Protect as Workbook.") For Each sht In Worksheets If sht.Name <> strshtname Then sht.Delete End If Next sht Application.GetSaveAsFilename strshtname ' You can save your file in number of formats. 'ThisWorkbook.SaveAs "d:myback" & Worksheets("sheet4").Range("a1").Text, xlNormal Application.DisplayAlerts = True End Sub nishith desai http://www.pexcel.com |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|