Copying Data from one Workbook to a different workbook - Values only

tlaltmey

New Member
Joined
Nov 10, 2021
Messages
20
Office Version
  1. 365
  2. 2019
I have the following lines of code:

VBA Code:
'Finds the last used row based on Column B and places it in the last empty row of Column A in the Log File
lDestLastRow = wsDest.Cells(wsDest.Rows.Count, "A").End(xlUp).Offset(1).Row

wsCopy.Range("G1").Copy _
    wsDest.Range("A" & lDestLastRow)

This copies the data from G1 of the first workbook and places it in the A column of the 2nd workbook. Is there a quick way to ensure that this does not paste the formula found in G1 and instead pastes the raw data value?

Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Don't copy the source range in its entirety, just take it's value and assign it to the destination range's value:
VBA Code:
wsDest.Range("A" & lDestLastRow).Value = wsCopy.Range("G1").Value
 
Upvote 0
Solution

Forum statistics

Threads
1,215,465
Messages
6,124,977
Members
449,200
Latest member
Jamil ahmed

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