Solved

Save sheet as workbook

Posted on 2014-01-17
2
364 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:Wass_QA
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:Wass_QA
ID: 39790516
thank you,
my issue was saving the new workbooks before the copy / paste special.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

706 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now