Copy worksheet (values only) to new workbook

Jing

Active Member
Joined
Feb 11, 2011
Messages
288
I have created the following macro to copy a worksheet called Parsed to a new workbook...
the problem that i am running into is that it is coping the actual formula's to the new workbook.
All i need it to do is copy the values in the worksheet so that the data will show in a new workbook.

Code:
Sub PARSE()
    Sheets("Parsed").Select
    Cells.Select
    Selection.Copy
    Sheets("Parsed").Select
    Range("A1").Select
    Columns("A:Q").Select
    Workbooks.Add
    ActiveSheet.Paste
End Sub
Thank you
 
Last edited:

Some videos you may like

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

drsarao

Well-known Member
Joined
Sep 9, 2009
Messages
1,112
Try this:

Code:
Sub PARSE()
    Workbooks.Add
    Workbooks([COLOR="#FF0000"]"Book2.xls"[/COLOR]).Sheets("Parsed").UsedRange.Copy Destination:=ActiveSheet.Range("A1")
End Sub
Change "Book2.xls" to workbook name in which "Parsed" sheet resides.
 

Jing

Active Member
Joined
Feb 11, 2011
Messages
288
this still copies the formula's to the new work book and not just the values in the cells.
so of course all of the data on the new workbook is errors or #name?, as it has no reference to the other sheets.

Any other Idea's?

thanks in advance.
 

drsarao

Well-known Member
Joined
Sep 9, 2009
Messages
1,112
this still copies the formula's to the new work book and not just the values in the cells.
so of course all of the data on the new workbook is errors or #name?, as it has no reference to the other sheets.

Any other Idea's?

thanks in advance.
My mistake.

Try this instead:
Code:
Sub PARSE()
    Workbooks.Add
    Workbooks("Book2.xls").Sheets("Parsed").UsedRange.Copy
    ActiveSheet.Range("A1").PasteSpecial xlPasteValuesAndNumberFormats
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,095,789
Messages
5,446,502
Members
405,404
Latest member
clead

This Week's Hot Topics

Top