Forum Discussion

PieGuy's avatar
PieGuy
Copper Contributor
Dec 16, 2022

Excel Macro or Pivot Table Help

I have a csv file, that i need to repeat certain cells in certain columns, and then also delete empty rows AND certain cells that would move that data up, so every row contains data with no blanks.   And I need to do this for each group of rows that has a new number (a PO#) in column A. 
I've attached screenshots of before and after. 

In Before - i need to repeat cells column C, F, L until there is a new cell in row 22. Then repeat it again for the info below cell 22 which may or may not be different. it's a new customer once the number in Column A changes.
I then need to delete the blank rows, and also annoyingly, delete the cells from M onwards to remove the blanks and shift cells up in line with the info in column L.
Any help much appreciated.  My excel skills are very intermediate but willing to learn!BeforeAfter

  • Lorenzo's avatar
    Lorenzo
    Silver Contributor

    PieGuy 

    This sounds doable with Get & Transform aka Power Query. Could you:
    - Upload & share (ie with OneDrive or any other file sharing service) a representative sample CSV with say 4 or 5 PO#
    - List precisely the columns you want to keep

    • PieGuy's avatar
      PieGuy
      Copper Contributor

      Lorenzo TPC CSV OneDrive.csv

      Link is linked. Thanks for the reply!! I would like to retain:
      Columns A, C, F, L, N, Q

       

      That's it! 

      Thanks in advance for any assistance.

       

      • Lorenzo's avatar
        Lorenzo
        Silver Contributor

        PieGuy 

         

        The file you shared is not a CSV file but an Excel file with a .csv extension

        Please clarify what your actual source file type is and re-share the actual file - Thanks

Resources