VBA Copying rows from sheet 1 to sheet 2-4 If containing specific text

  • Hello,

    In the process of building this userform for tracking purposes here at work. I have a sheet containing 6 columns. Basically I needed to code for the module to copy any rows from sheet 1 to sheet 2 if column 2 contained "Operations" or to sheet 3 if it contains "Scheduling". This works perfectly fine, however everytime the module is ran, it will duplicate the entries. Is there a code that it will detect any duplicates. I am new to coding so in all honesty I've built this from a grip of your guys's post lol. Forgive the randomness ive tried multiple ways and didn't delete anything just in case. And since it works now I haven't removed anything unnecessary.

    Thank you in advance for any assistance..

  • Re: VBA Copying rows from sheet 1 to sheet 2-4 If containing specific text

    Just a thought and I am sure there is a better way of doing this, but from my limited knowledge there are two ways I can think of. First if there is a unique identifier for each entry on the second page you could search the first page based on the unique identifier from the last row on the second page that contains text. Second if no identifier you could have a "reference cell" that stores what row on the first page was last copied to the second page and have it update any time a row is copied from the first page to the second.

    As I said there is probably better ways of doing this, but I think one of these would work.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!