+ Reply to Thread
Results 1 to 12 of 12

Prevent Duplicate Customer Names

  1. #1
    Forum Contributor
    Join Date
    02-26-2023
    Location
    Lousianna
    MS-Off Ver
    Microsoft 365
    Posts
    957

    Prevent Duplicate Customer Names

    Hello,

    On the Schedule sheet there is option to add new customer with VBA and then option to save. How can this prevent a duplicate customer name?

    Also can the customer selection drop down be in last name alphabetical order please?

    Any help or suggestions would be appreciated.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,366

    Re: Prevent Duplicate Customer Names

    Looking at the code, you do not appear to differentiate between (Or have the ability to) a NEW contact and UPdate to an existing customer

    so perhaps you need think about this.

    For duplicates, I would simply do a "Lookup" on the customer list, using customer name.
    Last edited by JohnTopley; 09-05-2023 at 04:26 PM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    02-26-2023
    Location
    Lousianna
    MS-Off Ver
    Microsoft 365
    Posts
    957

    Re: Prevent Duplicate Customer Names

    I should have changed the sheet name 'Customers' to 'Contacts'. I was trying to combine features from different workbooks.
    Last edited by billy60; 09-05-2023 at 04:34 PM.

  4. #4
    Forum Contributor
    Join Date
    02-26-2023
    Location
    Lousianna
    MS-Off Ver
    Microsoft 365
    Posts
    957

    Re: Prevent Duplicate Customer Names

    I should have asked for a way to check if that customer exists in the system (Contacts sheet). I will try to figure it out sorry for the trouble.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,366

    Re: Prevent Duplicate Customer Names

    You could use COUNTIF to check if it returned 1 which indicates the customer already exists.

  6. #6
    Forum Contributor
    Join Date
    02-26-2023
    Location
    Lousianna
    MS-Off Ver
    Microsoft 365
    Posts
    957

    Re: Prevent Duplicate Customer Names

    I have no idea how to do that in the save code.

  7. #7
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Prevent Duplicate Customer Names

    Please Login or Register  to view this content.
    Last edited by skywriter; 09-05-2023 at 09:27 PM. Reason: Fixed typo.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  8. #8
    Forum Contributor
    Join Date
    02-26-2023
    Location
    Lousianna
    MS-Off Ver
    Microsoft 365
    Posts
    957

    Re: Prevent Duplicate Customer Names

    Thank you I will try in the morning.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,366

    Re: Prevent Duplicate Customer Names

    in sheet "Schedule"

    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    2021
    Posts
    307

    Re: Prevent Duplicate Customer Names

    Also as an option:
    Please Login or Register  to view this content.
    Write the given code to the Schedule Sheet Module. Good Luck.

  11. #11
    Forum Contributor
    Join Date
    02-26-2023
    Location
    Lousianna
    MS-Off Ver
    Microsoft 365
    Posts
    957

    Re: Prevent Duplicate Customer Names

    I tried John Topley's solution. There is an issue though. The calendar has appointments that can be selected to show the details of that appointment. When clicking the popup shows that customer exists.

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,593

    Re: Prevent Duplicate Customer Names

    billy60
    Prevent Duplicate Customer Names
    Is it like that simple?
    If you are managing Appointment not to overwrap for the Customer then
    1)
    Insert bold lines in "Sub Appt_SaveUpdate"
    Please Login or Register  to view this content.
    2) Add below to the same code module
    Please Login or Register  to view this content.
    3)
    Also can the customer selection drop down be in last name alphabetical order please?
    Add following lines in Schedule Worksheeet_Activate event procedure.
    Please Login or Register  to view this content.
    All above is assuming your other part of codes are all working correctly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Customer Number vs Customer Names
    By MarkJohn51 in forum Excel General
    Replies: 14
    Last Post: 06-10-2020, 12:25 PM
  2. [SOLVED] Harmonisation of customer names
    By RSRSRS in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-20-2019, 01:05 PM
  3. vba excel - Prevent opening workbook with duplicate vba code but different file names
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-03-2018, 06:36 PM
  4. [SOLVED] Prevent Errors for Duplicate Tab Names When Naming Tabs Using Cell Reference
    By DeRo22 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-04-2014, 03:26 AM
  5. VBA code to ensure duplicate names map to same "customer number"
    By laurenh7 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2012, 03:06 AM
  6. Customer Names into Customer List
    By dustin470 in forum Excel General
    Replies: 2
    Last Post: 02-13-2010, 08:52 AM
  7. [SOLVED] Sorting customer names
    By seeking improvment in forum Excel General
    Replies: 4
    Last Post: 09-29-2005, 11:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1