Code to copy values over only and not formulas

propeller

New Member
Joined
Oct 21, 2016
Messages
13
I'm using the below to move a row from one tab to another, the problem is when it moved it over the formulas change value because they depend on different cells. Can I move values over only? Like a copy paste of the data, no calculation?



Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
Dim Lastrow As Long
Lastrow = Sheets("hires").Cells(Rows.Count, "A").End(xlUp).Row + 1
If Target.Value = "Active" Then
With Rows(Target.Row)
.Copy Destination:=Sheets("hires").Rows(Lastrow)
With Application
.CutCopyMode = False
.EnableEvents = False
End With
.EntireRow.Delete
Application.EnableEvents = True
End With
Application.EnableEvents = False




Application.EnableEvents = True
End If
Application.EnableEvents = True
End If
End Sub
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Re: Can Someone please edit this code to copy values over only and not formulas

Try
Code:
With Rows(Target.Row)
Sheets("hires").Rows(Lastrow).Value = .Value
 
Upvote 0
Re: Can Someone please edit this code to copy values over only and not formulas

Do any of the formulae in that row return an error?
 
Upvote 0
Re: Can Someone please edit this code to copy values over only and not formulas

But do any return an error on the original sheet?
 
Upvote 0
Re: Can Someone please edit this code to copy values over only and not formulas

Glad you sorted it & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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