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:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

drsarao

Well-known Member
Joined
Sep 9, 2009
Messages
1,143
Office Version
  1. 2007
Platform
  1. Windows
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,143
Office Version
  1. 2007
Platform
  1. Windows
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,129,804
Messages
5,638,455
Members
417,025
Latest member
MusterDuster

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top