+ Reply to Thread
Results 1 to 6 of 6

How to stop doubles from macro ?

  1. #1
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    How to stop doubles from macro ?

    Hello, I have this macro that gets values from a sheet and adds for each of the values 3 rows with each time a different value :

    Please Login or Register  to view this content.
    The problem I have is that if i add a value in the first sheet and rerun the macro, I will get doubles so i tought of adding this but it doesn't work :
    Please Login or Register  to view this content.
    What do i need to change ? (+Formula in sheet2 is not expanding correctly and I have no clue why ?)

    here is the sheet : Sample (1).xlsm
    Last edited by clemlcfc; 11-08-2022 at 10:44 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523

    Re: How to stop doubles from macro ?

    Could you first clear the existing data and then run the code?
    Excel 365 user. To unblock a downloaded macro-enabled workbook, go to your "Downloads" folder > right click on the workbook name > click 'Properties' > check the 'Unblock' checkbox. You can now open the workbook.

  3. #3
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Re: How to stop doubles from macro ?

    I could but I don't want the clear the existing data. I just want to clear the new duplicates

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,155

    Re: How to stop doubles from macro ?

    Ideally you would need to add a code snippet that checks to see if value already exists and if not then add it...
    Also, no need for concat formula...
    Please Login or Register  to view this content.
    Last edited by sintek; 11-08-2022 at 10:24 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Re: How to stop doubles from macro ?

    Thank you ! But the CONCAT formula was there to show that it wouldn't expand. And just something i saw if i add any column they will have automatically "#NA" as a value ?

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,155

    Re: How to stop doubles from macro ?

    Like I said...no need for concat formula code above solves that without formula
    But...If you really want a formula then this solves...
    Please Login or Register  to view this content.
    Thanks for rep +
    Last edited by sintek; 11-08-2022 at 11:22 AM.

+ 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. [SOLVED] take out ALL doubles from a column
    By incobart in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2018, 09:01 AM
  2. [SOLVED] I need a Macro that doubles rows when criterias are matched
    By isasa74 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-30-2012, 01:56 PM
  3. count doubles
    By newx in forum Excel General
    Replies: 3
    Last Post: 06-17-2012, 06:00 PM
  4. [SOLVED] How can I avoid doubles?
    By lauro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-29-2012, 06:11 PM
  5. Removing Doubles
    By DORMAX34 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-01-2007, 04:08 PM
  6. function or sub to dedect doubles
    By matrixknow in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-21-2007, 04:43 AM

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