VBA - copy&Paste value without formulas

Beatrice

Board Regular
Joined
Sep 17, 2019
Messages
85
Office Version
  1. 2019
Platform
  1. Windows
Hi, I am using Excel version 2007, i m very new to VBA, please help.

--quote--
Windows("Template.xlsm").Activate
Sheets("SUMMARY").Select
Range("A1:T52").Select
Selection.Copy
Windows("Destination File.xlsx").Activate
Sheets("COPY OF SUMMARY").Select
ActiveSheet.Paste
Range("A1").Select
Application.CutCopyMode = False
--end of quote--

The result did copy the cells, but as my "SUMMARY" contains values and formulas.
How can I copy and paste all cells in the area as VALUE only?

Thanks.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Windows("Macro Template 1.xlsm").Activate
Sheets("SUMMARY").Select
Range("A1:T52").Select
Selection.Copy
Windows("Destination File.xlsx").Activate
Sheets("COPY OF SUMMARY").Select
ActiveSheet.PasteSpecial Paste:=xlPasteFormulas
Range("A1").Select
Application.CutCopyMode = False


<< I also try some methods suggested from forum, but failed :confused:
it show error code " 1004", what does it mean?

Thanks in advance for helping
 
Upvote 0
Perhaps something like this will work?:

Code:
[COLOR=#333333]Windows("Macro Template 1.xlsm").Activate[/COLOR]
With Sheets("Summary").Range("[COLOR=#333333]A1:T52")
[/COLOR]      .Copy
End With
[COLOR=#333333]Windows("Destination File.xlsx").Activate
[/COLOR]With [COLOR=#333333]Sheets("COPY OF SUMMARY").Range("A1")
[/COLOR]      .PasteSpecial xlPasteValues
End With
 
Upvote 0
Code:
Sub xxx()
Workbooks("Macro Template 1.xlsm").Sheets("Summary").Range("A1:T52").Copy
Workbooks("Destination File.xlsx").Sheets("COPY OF SUMMARY").Range("A1").PasteSpecial xlPasteValues
End Sub
 
Upvote 0
Thank you Mark858,

I was wondering what I did wrong with the ".PasteSpecial xlPasteValues"
Lesson learn. :)
 
Upvote 0

Forum statistics

Threads
1,216,057
Messages
6,128,527
Members
449,456
Latest member
SammMcCandless

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
Back
Top