+ Reply to Thread
Results 1 to 13 of 13

Exception to remove duplicates function

  1. #1
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Exception to remove duplicates function

    Hello,

    I need a exception code for not deleting below content of my packing list.

    Let me be clear I wrote below function to clear all unwanted duplicated from my packing list. Unfortunately, some parts has same content as Gross weight and Net weight which below code consider as duplicates and delete it off.

    I want some code exception to surpass this content alone. Enclosed spreadsheet which has gross weight content which starts with lots of space as it's imported from a text file.

    Need your support please


    Sub DeleteRows()

    Please Login or Register  to view this content.
    End Sub
    Attached Files Attached Files
    Last edited by priyadharshane; 02-16-2019 at 06:04 AM.

  2. #2
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: Exception to remove duplicates function

    Hi,

    Can we make a condition if A column cell starts with Character 32 which is space it should not delete duplicates. I dont know how to compile in code. Can anyone support please?

    Please Login or Register  to view this content.
    Last edited by priyadharshane; 02-16-2019 at 06:05 AM.

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Exception to remove duplicates function

    Please attach a file that has more data and then explain in detail what you want to do referring to specific cells, rows and columns. It would help if you could include a sheet that contains the expected results after running the macro.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: Exception to remove duplicates function

    Enclosed attachment as requested. I dont want rows highlighted in yellow deleted as duplicates

    I need this content. I tried to filter out and do remove duplicates but its not working
    Attached Files Attached Files

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Exception to remove duplicates function

    Try this on a copy of your file:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: Exception to remove duplicates function

    @ Mumps1

    I'm sorry as im not clear enough to you

    I highlighted the cell in yellow only for clarity. This is our packing list and it tends to change as dynamic

    If you closely look at highlighted cell it contains Gross weight and Net weight of the boxes shipped.

    Sometimes it has same value, when I apply remove duplicates function VBA assuming this as duplicates and deleting it which is needed. As you see all data is in Column A

    since i'm importing it from a text file. So, I dont any content in B column which will affect text to column macro which i'm applying latter part

    Prime goal of this procedure is to delete all duplicates in Column A excluding cells with gross weight in it. Excel should not consider this cell whilst deleting duplicates

    Also, there should not be any content in Column B. I tried to filter and exclude cells with gross weight in it and apply remove duplicates function. Still, It is getting deleted
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Exception to remove duplicates function

    Try this version:
    Please Login or Register  to view this content.
    Column B which is a helper column will be cleared.

  8. #8
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: Exception to remove duplicates function

    @ Mumps1 - Awesome, it's great work and helped us to automate hectic work . You are the best

    I have one more question and just let know if it's possible are not. Please let know If I need to post as different one

    I will explain you the steps I do - I run a macro - It asks me to upload packing list text file - Macro runs and add new sheet before sheet 1 naming with text file itself.

    My question - Is it possible to copy added sheet (Sheet name = Text file name) - Open a new work book - Paste the content and save workbook as Sheet name into specified location in computer

    Let says C:\Users\Desktop\Packing list as of now. I will change it later - Text file name = Macro run sheet name = Workbook name should be same. I have already done first two.

    last copied sheet must be deleted (Not sheet 1 only Macro run sheet)

    Can this be done?

    Kudos Mate!! I need to add more reputation for you

  9. #9
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Exception to remove duplicates function

    Can you post the macro you run to upload packing list text file?

  10. #10
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: Exception to remove duplicates function

    Here you go
    Please Login or Register  to view this content.

  11. #11
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Exception to remove duplicates function

    Try:
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: Exception to remove duplicates function

    @ Mumps1

    Few things, I need to copy and save macro file only after it runs. So I added this code to compiled one

    Few things causing issue,

    One - It is copying sheet 1 as well and saving it in location. I dont want to consider sheet 1 which is empty

    Two - New work books added is not closing. I want to get it saved in specific location thats it - I added code close active work book

    Three - Active sheet which is being copied is not deleting once pasted


    Please Login or Register  to view this content.
    Last edited by priyadharshane; 02-16-2019 at 05:20 PM.

  13. #13
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Exception to remove duplicates function

    Please post the ImportPackinglistTextFile macro. You want to loop through all the sheets in the Packinglist(s) file, ignoring "Sheet1". Then you want to copy each sheet to a new workbook and save the new workbook, close the new workbook and delete the copied sheet in the Packinglist(s) file. This this correct?

+ 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. Remove Duplicates Function
    By Prodetik in forum Excel General
    Replies: 2
    Last Post: 10-04-2016, 05:39 PM
  2. [SOLVED] Remove Duplicates Function for Single Cells
    By the_red_engine in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-17-2016, 08:20 PM
  3. Remove Duplicates Function
    By Keshypops in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-17-2015, 06:59 AM
  4. Remove duplicates function not removing duplicates
    By Berilium2 in forum Excel General
    Replies: 3
    Last Post: 04-01-2015, 06:55 AM
  5. [SOLVED] function to remove duplicates from different sheets
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-03-2014, 08:03 AM
  6. Top 40 values with duplicates and with exception
    By Fabienne88 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-02-2013, 07:57 AM
  7. How to use find/replace to remove back carriages BUT make exception to bullet points?
    By WoW_Excel_girl88 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-16-2012, 12:27 PM

Tags for this Thread

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