Hello guys,
I have been trying to find the solution for this but I still cannot get it right, please help as my head is about to explode now, really.
In attached file and screenshot I am trying to achieve that when user clicks on invoice number and hits the LoopClick button, macro copies all the raws that are within the same customer and stops once this is done for one customer.
Lets say user clicks on invoice number 11201686 and hits the button, macro starts copying all the lines from A.M. Marketing customer and stops once all the lines are copied to sheet HideLater2 one by one.
I must have tried almost all of the loop functions but the further I got was that I can loop through until the last raw of, lets say, A.M. Marketing but looping does not copy the last line because of the offset setting that I just have not right, i dont know.
I was trying to make looping work first and then applying the copy/paste functions so you will see that it loops and does some bullshit but this is just because I could not get through the first stage - getting the loop right and the rest of the code is copied from some web.
Is there please someone who could help me? It must be something easy, some while loop or until loop and it just must stop once all the customer invoice lines are copied. I just cannot get this right.
Thank you very much!!!
Code:
Please Login or Register to view this content.
Bookmarks