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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You are very welcome. I'm glad it all worked out. :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
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