ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save (https://www.excelbanter.com/excel-programming/358102-save.html)

Ernie

Save
 
I have this problem, my excel workbook is very big. 4 mega bytes. i need to
develop a macro to save only a worksheet from the workbook. How do i
accomplish this?

Thank You
Ernie

[email protected]

Save
 
You could create a new workbook, copy the worksheet, and then save the
new workbook. COde for that below...

Dim NewFile As String
NewFile = "C:\NewFile.xls"

'Select what you want to copy
Range("A2:I200").Select
Selection.Copy

'Create your new workbook and paste
Workbooks.Add
ActiveSheet.Paste

'Save it
ActiveWorkbook.SaveAs Filename:=NewFile, FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False,
_
CreateBackup:=False



All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com