Blog‎ > ‎IT‎ > ‎

Excel VBA copy sheet values only

posted Dec 28, 2013, 1:36 AM by Jake Vosloo   [ updated Dec 28, 2013, 1:53 AM ]
Today I wanted to copy the values from every sheet in one workbook into a new workbook with only the values.  Here is what worked for me eventually:

For Each Sheet In Sheets
    Set NewWorkbook = Workbooks.Add
    Sheet.UsedRange.Copy
    NewWorkbook.Sheets.Item(1).Cells(1, 1).PasteSpecial Paste:=xlPasteValues
...


The URLs where I found advice were in no order of preference:
http://www.mrexcel.com/forum/excel-questions/571065-used-range-copy-paste-values.html
http://www.ozgrid.com/forum/showthread.php?t=37957
http://www.ozgrid.com/forum/showthread.php?t=79718
http://stackoverflow.com/questions/14881032/copy-excel-sheet-to-another-excel-book-but-just-formats-and-values
http://stackoverflow.com/questions/17565456/macro-to-copy-values-only-from-one-sheet-to-another
http://www.mrexcel.com/forum/excel-questions/650606-copy-worksheet-values-only-new-workbook.html



Comments