Pteroglossus
New Member
- Joined
- Nov 19, 2020
- Messages
- 14
- Office Version
- 365
- Platform
- Windows
I created a VBA script that automatically imports and formats daily-generated csv files then copies formulas and displays results. (Same project as my previous question here).
The last step of this macro is the transposition of the dynamically-located data at the bottom of the table ("J" & lastRow + 1 & ":AA" & lastRow + 4) to a fixed range "AG1:AJ18" in order to sum all the data up in monthly dashboard files.
I tried two ways:
Which both work once when the file are generated, but when I manually modifiy the data within the table later, the tranposed data is not updated.
I read about "worksheet.change events", but they would need to be included in the code of each generated worksheet...which sounds complicated.
Isn't there an easier way to achieve this?
The last step of this macro is the transposition of the dynamically-located data at the bottom of the table ("J" & lastRow + 1 & ":AA" & lastRow + 4) to a fixed range "AG1:AJ18" in order to sum all the data up in monthly dashboard files.
I tried two ways:
Excel Formula:
Range("AG1:AJ18").Value = WorksheetFunction.Transpose(Range("J" & lastRow + 1 & ":AA" & lastRow + 4))
And
Range("J" & lastRow + 1 & ":AA" & lastRow + 4).Copy
Range("AG1:AJ18").PasteSpecial Paste:=xlPasteValues, Transpose:=True
Which both work once when the file are generated, but when I manually modifiy the data within the table later, the tranposed data is not updated.
I read about "worksheet.change events", but they would need to be included in the code of each generated worksheet...which sounds complicated.
Isn't there an easier way to achieve this?