Copy/Paste values from one sheet to another

steveno55

New Member
Joined
Jan 2, 2018
Messages
2
Hi all,

Not that great on Excel so looking for some help please. I have the below VBA that will transfer data from certain cells on Worksheet 1 to different cells on Worksheet 2. It is copying the formulas in these cells where I need it to copy just the values.

Sub DataTransfer()


Dim ws1 As Worksheet, ws2 As Worksheet
Dim DestRow As Long
Set ws1 = Sheets("Data Entry")
Set ws2 = Sheets("Results")
DestRow = ws2.Cells(Rows.Count, "C").End(xlUp).Row + 1
ws1.Range("K22").Copy ws2.Range("C" & DestRow)
ws1.Range("K23").Copy ws2.Range("D" & DestRow)
ws1.Range("K24").Copy ws2.Range("E" & DestRow)
ws1.Range("F30").Copy ws2.Range("F" & DestRow)
ws1.Range("F26").Copy ws2.Range("H" & DestRow)
ws1.Range("K28").Copy ws2.Range("I" & DestRow)
ws1.Range("K27").Copy ws2.Range("J" & DestRow)
ws1.Range("F24").Copy ws2.Range("K" & DestRow)
ws1.Range("G36").Copy ws2.Range("L" & DestRow)
ws1.Range("G35").Copy ws2.Range("M" & DestRow)


End Sub

Hoping I have worded it OK above and any help would be much appreciated.

Thanks
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi & welcome to the board.
try it like this
Code:
 ws2.Range("C" & DestRow).Value = ws1.Range("K22").Value
 
Upvote 0
Welcome to the Board!

Try this:
Code:
Sub DataTransfer()

Dim ws1 As Worksheet, ws2 As Worksheet
Dim DestRow As Long

Set ws1 = Sheets("Data Entry")
Set ws2 = Sheets("Results")

DestRow = ws2.Cells(Rows.Count, "C").End(xlUp).Row + 1

ws2.Range("C" & DestRow) = ws1.Range("K22").Value
ws2.Range("D" & DestRow) = ws1.Range("K23").Value
ws2.Range("E" & DestRow) = ws1.Range("K24").Value
ws2.Range("F" & DestRow) = ws1.Range("F30").Value
ws2.Range("H" & DestRow) = ws1.Range("F26").Value
ws2.Range("I" & DestRow) = ws1.Range("K28").Value
ws2.Range("J" & DestRow) = ws1.Range("K27").Value
ws2.Range("K" & DestRow) = ws1.Range("F24").Value
ws2.Range("L" & DestRow) = ws1.Range("G36").Value
ws2.Range("M" & DestRow) = ws1.Range("G35").Value

End Sub

Edit: Looks like I am too slow and Fluff already posted this!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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