Copying Rows Based on 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 workbook with say an inventory work sheet and then 3 subsequent sheets. I want the row to be moved to a certain sheet based off of the Value entered from the dropdown in Column N. Currently the first part of the code works when it is marked Incomplete, but it will not move anything marked completed. Im sure its an easy solution but Im struggling, any and all help appreciated!

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

'   Check to see only one cell updated
    If Target.CountLarge > 1 Then Exit Sub
   
'   Check to see if entry is made in column B after row 5 and is set to "Yes"
    If Target.Column = 14 And Target.Row > 7 And Target.Value = "Incomplete, Moved to Site Inspection Sheet" Then
        Application.EnableEvents = False
'       Copy columns B to I to complete sheet in next available row
        Range(Cells(Target.Row, "C"), Cells(Target.Row, "O")).Copy Sheets("LF WDIF SI").Cells(Rows.Count, "C").End(xlUp).Offset(1, 0)
'       Delete current row after copied
        Rows(Target.Row).Delete
        Application.EnableEvents = True
       
    End If
   
End Sub

Private Sub Followup_Transfer(ByVal Target As Range)

'   Check to see only one cell updated
    If Target.CountLarge > 1 Then Exit Sub
   
'   Check to see if entry is made in column B after row 5 and is set to "Yes"
    If Target.Column = 14 And Target.Row > 7 And Target.Value = "Complete, Moved to WDIF FUF Sheet" Then
        Application.EnableEvents = False
'       Copy columns B to I to complete sheet in next available row
        Range(Cells(Target.Row, "C"), Cells(Target.Row, "J")).Copy Sheets("WDIF FUF").Cells(Rows.Count, "C").End(xlUp).Offset(1, 0)
'       Delete current row after copied
        Rows(Target.Row).Delete
        Application.EnableEvents = True
       
    End If
   
End Sub
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
How do you trigger "Followup_Transfer (ByVal Target As Range)"?
I don't have 365 or 2021.
 
Upvote 0

Forum statistics

Threads
1,224,698
Messages
6,180,422
Members
452,981
Latest member
MarkS1234

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