Macro with destination paste values only

mbee14

New Member
Joined
Dec 19, 2019
Messages
9
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
  2. Mobile
  3. Web
How do I change this code to paste only values?

Workbooks(Format(Now - 1, "yymmdd") & "Prod Report .xlsm").Activate

Sheets("Night Shift Production").Activate

Sheets("Night Shift Production").Range("H51:H53").Copy

Workbooks("Line Info.xlsm").Activate

ActiveSheet.Paste Destination:=Worksheets("L1-10").Range("I72")
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
How about
VBA Code:
Workbooks(Format(Now - 1, "yymmdd") & "Prod Report .xlsm").Activate

Sheets("Night Shift Production").Range("H51:H53").Copy

Workbooks("Line Info.xlsm").Activate

Worksheets("L1-10").Range("I72").PasteSpecial xlPasteValues
 
Upvote 0
How about
VBA Code:
Workbooks(Format(Now - 1, "yymmdd") & "Prod Report .xlsm").Activate

Sheets("Night Shift Production").Range("H51:H53").Copy

Workbooks("Line Info.xlsm").Activate

Worksheets("L1-10").Range("I72").PasteSpecial xlPasteValues


It gave me a run-time error 1004
 
Upvote 0
I did some more googling and this ended up working for me

Sheets("Day Shift Production").Activate

Set r1 = Range("B6", "C8")

Workbooks("Line Info.xlsm").Activate

Set r2 = Range("B6")

r2.Value = r1.Value
 
Upvote 0
Glad you sorted it & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,217
Members
452,619
Latest member
Shiv1198

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