Forum Discussion

MarieParis's avatar
MarieParis
Copper Contributor
Nov 29, 2020
Solved

Transpose the table on VBA with missing values for the dates

Hello Experts, I'm novice in VBA. I'm trying to transpose my data:  I would like to have this result:    I tried all day the methodes like: Resize(UBound(Table2, 1), UBound(Table2, 2)...
  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Nov 29, 2020

    MarieParis As said, it's difficult to help if I don't see the entire "picture". That is, all you want to achieve. The pivot table is created with the macro, and it's created in the cell you indicate.

     

    Now that the PT is in place, and if based on a structured table, you should not have to press the button anymore. And that is what I really meant earlier. You don't need a macro to do the transposing of your data. Create the PT once and refresh it (Data ribbon, Refresh All) when data is added to the table. The "transposed" table will be "recalculated" instantly. Should you want that step to be automated, then you can have a macro (and a button) that does the refreshing for you. But it would be practically the same as pressing the refresh button in the Data ribbon.

     

    I apologise if I'm not clear.

     

    (Picture taken on a Mac, but it looks similar on a Excel for Windows)

Resources