PDA

View Full Version : VBA - Convert data table into a long list (multiple columns)



Jovannivk
07-01-2022, 08:46 AM
Hi everyone,


I'm running into a problem and can't convert it into VBA code.


In the attached appendix you will find a file with an analysis and output sheet. I would like to find something that adds data from a table per person to each other with the corresponding account code. In the output sheet I made an example of how I would like it to look.
So for each 'person' I have 3 values ​​that I must have among each other with the corresponding account code next to it. So this will be three lines. In this way I want x3 lines under each other for each person. Then the next item comes in, the same story here.


You could immediately use 6 lines for 1 person. However, in my work file I work with hundreds of persons and dozens of account codes. So I want as few 'zero' lines as possible in my output. Some account rules can be completely zero.


I hope that's a bit clear. Thanks for the help!


Greetings,
Jovanni

snb
07-01-2022, 09:27 AM
Crossposted at https://www.helpmij.nl/forum/showthread.php/964917-VBA-Tabel-met-meerdere-kolommen-omzetten-in-een-long-list

Aussiebear
07-01-2022, 04:08 PM
Firstly, unmerge the cells C2:F2. Then select Cell C2 and use Excel's Text to Columns function to split the data based on commas.
Next use the Replace function to change the "+" to ",".

arnelgp
07-01-2022, 11:29 PM
using VBA, so you need to test.
i think this was requested before...