Solved

Save sheet as workbook

Posted on 2014-01-17
2
417 Views
Last Modified: 2014-01-18
Hello,
I'm using below code to save each sheet as a separate workbook,
the problem I have is, it is saving the formulas to the new workbooks as well.
how can I save only the values.
any help is appreciated,

Sub Second_Create_Workbooks()
Dim wbDest As Workbook
Dim wbSource As Workbook
Dim sht As Object
Dim strSavePath As String


strSavePath = "C:\Users\Wassim.QA-DOMAIN\Clients_Reports\"
Set wbSource = ActiveWorkbook
For Each sht In wbSource.Sheets
sht.Copy
Set wbDest = ActiveWorkbook
wbDest.SaveAs strSavePath & sht.Name
wbDest.Close
Next

Application.ScreenUpdating = False
Exit Sub
End Sub
0
Comment
Question by:W.E.B
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
Sreeram earned 300 total points
ID: 39790186
HI,

      you can use paste special option.


Try the below step to get the value along with its  format :

1.Create a copy of the Excel sheet.
2.Select The Entire sheet (CTRL+A).
3.Copy the content
4. Using paste special paste only the value in the same sheet.
5.save the workbook.


Sample code:

    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
0
 

Author Closing Comment

by:W.E.B
ID: 39790516
thank you,
my issue was saving the new workbooks before the copy / paste special.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question