Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Save sheet as workbook

Posted on 2014-01-17
2
Medium Priority
?
425 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 1200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

609 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