Forum Discussion

safwen's avatar
safwen
Brass Contributor
Oct 20, 2022

macro to select lignes

Hey guys please i Want to select those lignes and copy then to another worksheet using macro but the length it's variable any ideas please

 

3 Replies

  • mathetes's avatar
    mathetes
    Silver Contributor

    safwen 

     

    There's a little bit of ambiguity in your request. By "lignes" do you mean the column in the worksheet with that heading, OR do you mean lines, all of the lines--four at present--but sometimes more, sometimes fewer?

     

    You might well be able to do this, especially if you're talking lines, with the FILTER function. No macro needed. It does require a relatively new version of Excel.

    • safwen's avatar
      safwen
      Brass Contributor

      mathetes 

      i want to automatise the process because i do it daily. 

      I can't insert them so i can't save maco to do it. 

      • mathetes's avatar
        mathetes
        Silver Contributor

        safwen 

         

        You still didn't really answer all of my questions for clarification.

         

        Did you look at FILTER and what it can do? It might--again, depending on exactly what it is you want brought over from sheetA to sheetB--do it without macro. THAT was my point.

         

        What you need is the result, not the method to get to the result. Maybe that method  would indeed have to be a macro; but maybe a FILTER function could do it even more seamlessly. 

         

        Unfortunately, I'm going on a trip in a few minutes and won't be able to continue with you; somebody else is going to have to pick up the thread. But I really recommend you at least take a look at FILTER and what it can do. Maybe this YouTube video would help you.

        https://www.youtube.com/watch?v=9I9DtFOVPIg

         

Resources