• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

SaveAs a tab in new Workbook

sgmpatnaik

Active Member
Hello

Good Afternoon

how to SaveAs a particular Tab in a new Workbook with fixed formats, xlValues
i can manage the code but there is one problem that i have some cells are merged so i can't manage that part

here i have a code which is Save As with formulas and fixed formats

Code:
Sub SaveSheet()
 
Dim New_file_name
' Written by Barrie Davidson
New_file_name = Application.GetSaveAsFilename(, "Microsoft Excel Workbook (*.xls), *.xls")
ActiveSheet.Copy
ActiveWorkbook.SaveAs Filename:=New_file_name, FileFormat:=xlNormal
ActiveWindow.Close
End Sub

but i want to Save the Sheet with xlValues and Format

kindly help

With Regards
 
Hi,
Try this
Add the following code just before your ActiveSheet.Copy

Cells.Select
Selection.UnMerge
 
Hi sgmpatnaik,

SaveAs the worksheet Normal as you are doing now (This should bring in the sheet along with formula & formats). Copy all cells and paste as values. Try the below.

Code:
Sub SaveSheet()
 
Dim New_file_name
' Written by Barrie Davidson
 
New_file_name = Application.GetSaveAsFilename(, "Microsoft Excel Workbook (*.xls), *.xls")
ActiveSheet.Copy
ActiveWorkbook.SaveAs Filename:=New_file_name, FileFormat:=xlNormal
 
Application.Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
ActiveWindow.Close
End Sub
 
Back
Top