Excel

DrDrPath

New Member
Joined
Aug 11, 2022
Messages
1
Office Version
  1. 365
  2. 2016
  3. 2011
Hello,

New here. I've been looking at other similar solutions to what I'm trying to do but a little bit stumped.

When my entries in the N column = yes, I would like for the entry to be copied, deleted and pasted/ cut and pasted from the New Visitors Sheet and moved to the next available row in Completed Visits.

Thanking you all kindly in advanced.

Visit Logbook.xlsx
ABCDEFGHIJKLMN
1Date RequestedName (Firstname, Last name)Email ContactDesignationCurrent InstitutionCurrent DepartmentDates for visitNumber of Days TotalConfirmedNotified Administrator for paperworkWelcome Letter ProvidedTimetable ProvidedFeedback CompletedSession Complete?
202/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug1yesyesyesyesyesyes
302/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug3yesyesyesyesyesyes
402/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug3yesyesyesyesyesyes
502/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug3yesyesyesyesyesno
602/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug3yesyesyesyesyesyes
702/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug3yesyesyesyesyesno
802/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug3yesyesyesyesyesyes
902/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug3yesyesyesyesyesyes
1002/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug2yesyesyesyesyesyes
1102/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug3yesyesyesyesyesno
1202/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug3yesyesyesyesyesno
1302/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug2yesyesyesyesyesyes
1402/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug3yesyesyesyesyesyes
1502/08/2022John Smithjohn.smith@email.comVisitorInstitutionInstitutionaug3yesyesyesyesyesyes
New Visitors
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
This macro should work based on your sample data. Paste this code into the 'New Visitors' code page in VBA Editor, and it will get triggered whenever you make a change on that sheet. It checks to see that the change occurred in Column N, and that the new value is "yes" (or "Yes" or "YES" or "YeS", etc. since the code converts the value to UCase to compare to "YES".
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("N:N")) Is Nothing Then
    If UCase(Target.Value) = "YES" Then
        Dim nextrow As Long
        nextrow = Sheets("Completed Visits").Range("A" & Rows.Count).End(xlUp).Row + 1
        
        Application.EnableEvents = False
        Sheets("Completed Visits").Range("A" & nextrow).Resize(1, 14).Value = Sheets("New Visitors").Range("A" & Target.Row).Resize(1, 14).Value
        Sheets("New Visitors").Range("A" & Target.Row).EntireRow.Delete
        Application.EnableEvents = True
    End If
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,187
Messages
6,123,540
Members
449,107
Latest member
caya

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