Paste special paste values

Luke1690

Board Regular
Joined
Jul 26, 2022
Messages
101
Office Version
  1. 2016
Platform
  1. Windows
hi,
Im using this code to paste to another workbook on the next available line. All is working , i just need it to paste values and not formulas.


'1. Find last used row in the copy range based on data in column A
lCopyLastRow = wsCopy.Cells(wsCopy.Rows.Count, "M").End(xlUp).Row

'2. Find first blank row in the destination range based on data in column A
'Offset property moves down 1 row
lDestLastRow = wsDest.Cells(wsDest.Rows.Count, "B").End(xlUp).Offset(1).Row

'3. Copy & Paste Data
wsCopy.Range("M6:U" & lCopyLastRow).copy wsDest.Range("B" & lDestLastRow)

I think i know the command i need to enter .PasteSpecial Paste:=xlPasteValues just not sure where or if it is correct.
can someone help?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Try:
VBA Code:
wsCopy.Range("M6:U" & lCopyLastRow).copy 
wsDest.Range("B" & lDestLastRow).PasteSpecial Paste:=xlPasteValues
 
Upvote 0
Solution
wsCopy.Range("M6:U" & lCopyLastRow).copy wsDest.Range("B" & lDestLastRow).PasteSpecial Paste:=xlPasteValues

thankyou.
honestly, the first thing i tried was putting it on the end and it wasn't having it. I've just copied what you've typed and its worked.........

thanks again.
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,048
Members
448,543
Latest member
MartinLarkin

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