Solved

Save sheet as workbook

Posted on 2014-01-17
2
399 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
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
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 demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

860 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