Renaming duplicate column names

  • Do you have any blank cells in column A?

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • I tried the macro on the file you posted after moving the data to column B, and it worked properly. The error you got indicates that there is no filtered data to analyze. This makes no sense because the filter criteria is taken from the array which was created using the existing data in column B so there should always be data visible after the filtering is done. The only thing I can suggest is that you post a copy of your actual file, de-sensitized if necessary) so that I can test the macro on the actual data.

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Can I skip 6-11 lines of the code as it is taking lot of time and the excel I have has 80k rows

    I see you've moved on , but this is a reply to post #15. It may be a little quicker...

    If I've been helpful, let me know. If I haven't, let me know that too.

  • No, it shouldn't.

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Hi @ dangelor thanks for the code if there is any duplicate it has to add _1.pdf,_2.pdf to it...in the above code it is adding A11.pdf,A22.pdf it should be like A1_1.pdf and A2_2.pdf

  • Added the dash...

    If I've been helpful, let me know. If I haven't, let me know that too.

  • Try...

    If I've been helpful, let me know. If I haven't, let me know that too.

  • Try this version...

    If I've been helpful, let me know. If I haven't, let me know that too.