Good Afternoon!
I am wanting to combine two separate but similar VBA codes into one. I am currently using the code below. What this does is identifies a value in the L:L column marked as Filled on the "Display" spreadsheet and moves that entire Row to the "Filled" Worksheet. I would like to add a code that identifies the value Submitted in the same L:L column on the "Display" worksheet and Copy then delete that entire row to another worksheet called "Submitted". Let me know if any of that makes sense or not.
![]()
Private Sub Worksheet_SelectionChange (ByVal Target As Range) Dim xRg As Range Dim xCell As Range Dim I As Long Dim J As Long Dim K As Long I= Worksheets ("Display").UsedRange.Rows.Count J= Worksheets ("Filled").UsedRange.Rows.Count If J = 1 Then If Applications.WorksheetFunction.CountA (Worksheets ("Filled").UsedRange) = 0 Then J = 0 End If Set xRg = Worksheets ("Display"). Range ("L1:L" & I) On Error Resume Next Application.ScreenUpdating = False For K = 1 To xRg.Count If CStr (xRg (K).value) = "Filled" Then xRg (K) . EntireRow.Copy Destination:=Worksheets (Filled").Range("A" & J +1) xRg (K) . EntireRow.Delete If CStr (xRg (K).value) = "Filled" Then K+K -1 End If J=J+1 End If Next Application.ScreenUpdating = True End Sub
Bookmarks