?
Solved

Save sheet as workbook

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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 how to use a scrolling table in Microsoft Excel using the INDEX function.

800 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