Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel Workbook to be pasted as Values

Posted on 2012-03-14
3
Medium Priority
?
197 Views
Last Modified: 2012-06-27
I have a Master file Report that has 189 Sheets.  They are one page data results per a particular sales region.  The data in the report results in multiple VLookUPs from many other data sources.  

I have to email this report, but want to copy it and paste it as values so not so large with all the look up.  How do I do this without going into each sheet copying and re pasting as values?  Can I copy the entire Workbook and past as values?
0
Comment
Question by:mishlce
[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
3 Comments
 
LVL 42

Expert Comment

by:dlmille
ID: 37722941
You can in a few steps.  Select each tab, all cells top left of the formula bar at the intersection of column names and row numbers, then hit Copy, PasteSpecial, Values.

Or, you can use this code:
Sub pasteValues()
Dim wkb As Workbook
Dim wks As Worksheet

    Set wkb = ActiveWorkbook
    
    For Each wks In wkb.Worksheets
        wks.Cells.Copy
        wks.Cells.PasteSpecial xlPasteValues
        Application.CutCopyMode = False
    Next wks
    MsgBox "Process Complete!"
End Sub

Open in new window


Hit ALT-F11 to go to the VBA Editor, on the left, find your workbook and click on ThisWorkbook, then Right Click and INSERT MODULE.  Copy/Paste this code, there.

Then, Run the code - e.g., hit F5 which should make that workbook values only.

Alternatively, if you have PDF Writer capability, you could print each sheet to PDF and mail that.

Hope this helps.  Let me know if you need help integrating the macro.

Dave
0
 
LVL 42

Accepted Solution

by:
dlmille earned 2000 total points
ID: 37722965
I've eased this a bit, with revised code, and also you can run it and use the menu in your Add-Ins menu area.  ConvertWorkbook will convert the Active Workbook all to values.  So be careful to make a backup and save your updated workbook to a new name/location, accordingly.

Revised code:
Option Explicit

Sub pasteValues()
Dim wkb As Workbook
Dim wks As Worksheet
Dim wksStart As Worksheet

    Application.ScreenUpdating = False
    
    Set wkb = ActiveWorkbook
    Set wksStart = wkb.ActiveSheet
    
    Application.EnableEvents = False
    For Each wks In wkb.Worksheets
        wks.Cells.Copy
        wks.Cells.PasteSpecial xlPasteValues
        Application.CutCopyMode = False
        wks.Activate
        wks.Range("A1").Select
    Next wks
    Application.EnableEvents = True
    
    wksStart.Activate
    
    Application.ScreenUpdating = True
    
    MsgBox "Process Complete!"
    
End Sub

Open in new window


So, pull up the attached file, and the Add-In menus will be there.  THEN, pull up any workbook you want to convert and use the ConvertWorkbook! menu you find in the Add-Ins menu.

Cheers,

Dave
convertWkbToValues.xls
0
 

Author Closing Comment

by:mishlce
ID: 37725493
Awesome!! again huge time saver for me.  Worked perfectly!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

670 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