move a row when a specific value is entered and add date and user stamp.

DMO123

Board Regular
Joined
Aug 16, 2018
Messages
99
Hi All,

so i have probably a common question but i cannot figure it out.

I am trying to move a whole row based on what is entered in column F. so if i enter "Yes" in column F the whole row should move to Sheet6 finding the next available line in the table.

i have the code below that moves the row to the sheet i need and finds the next available line but it does not go in to the table for some reason? also want to add a date stamp of the move and a user stamp. the date stamp should show in column N and the username stamp should show in column O
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Value = vbNullString Then Exit Sub
    If Intersect(Target, Columns("F:F")) Is Nothing Then Exit Sub
    
    Application.ScreenUpdating = False
    
    If Target.Value = "Yes" Then
        Target.EntireRow.Copy Sheet6.Range("A" & Rows.Count).End(3)(2)
        Target.EntireRow.Delete
    End If
    
    Sheet6.Columns.AutoFit
    
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End Sub


 
Last edited by a moderator:
thanks for your help i was able to shift some bits around and it worked. thank you for all your help!
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You are very welcome. I'm glad it all worked out. :)
 
Upvote 0

Forum statistics

Threads
1,216,526
Messages
6,131,187
Members
449,631
Latest member
mehboobahmad

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