A VBA Code to Transfer rows of cells across Sheets based on Certain Column Value

jesuisazep

New Member
Joined
Nov 13, 2024
Messages
3
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
Hello So I have two identical sheets that relate to eachother based on correspondance from clients etc. I want a VBA code that will copy the Entire row from sheet 1 pictured below to sheet 2 based on Column N saying "Incomplete". I also would like it to update automatically based on if the status changes if that is at all possible. Any help or guidance would be appreciated, I thought I had it figured out with a sample code below but it will not update after the second user is entered it continuously overrides the same row

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Target.Column <> 14 Then Exit Sub
    If Target = "Incomplete, Moved to Site Inspection Sheet" Then
        With Sheets("LF WDIF SI")
            Target.EntireRow.Copy .Cells(.Rows.Count, "A").End(xlUp).Offset(7)
        End With
    End If
    Application.ScreenUpdating = False
End Sub


1731511310314.png
 
Last edited by a moderator:

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi,
I'm not sure if this is what You want .
just try
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
If Target.Column = 14 Then
 Application.EnableEvents = False
If Target.Value = "Incomplete" Then
With Sheets("LF WDIF SI")
Target.EntireRow.Copy .Cells(.Rows.Count, "A").End(xlUp).Offset(1)
End With
End If
End If
Application.EnableEvents = True
End Sub
 
Upvote 0
@jesuisazep
For the future, when posting vba code in the forum, please use the available code tags. It makes your code much easier to read/debug & copy. My signature block below has more details. I have added the tags for you this time. 😊
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,098
Members
453,021
Latest member
Justyna P

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