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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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