Hello everyone,
I'm wondering if someone could give advice on a problem I'm having, to see if I'm going completely in the wrong direction before I start with this.
I have a query that runs in Access that I would like to export to Excel. My exporting code works fine, but I would like to change the visual layout of the spreadsheet.
I think it will be much easier just to show this visually. Currently my spreadsheet structure is like this when it's exported:
Is there a way to make it grouped like this:
The challenge is that I don't know a priori how many rows or columns there will be. Those numbers are determined programatically, based on user input.
My only idea as of now is to do a series of nested loops and if statements, but I'm still trying to picture them all in my mind. I'm sure I can eventually figure this out, but is there another way that's easier? It's kind of like a transpose, but not completely.
Thanks for reading!
I'm wondering if someone could give advice on a problem I'm having, to see if I'm going completely in the wrong direction before I start with this.
I have a query that runs in Access that I would like to export to Excel. My exporting code works fine, but I would like to change the visual layout of the spreadsheet.
I think it will be much easier just to show this visually. Currently my spreadsheet structure is like this when it's exported:
Code:
ID | Comments
1 | A
1 | B
2 | C
3 | D
3 | E
3 | F
3 | G
4 | H
5 | I
5 | J
.....
Is there a way to make it grouped like this:
Code:
ID | Comment 1 | Comment 2 | Comment 3 | Comment 4 | .
1 | A | B | | | .
2 | C | | | | .
3 | D | E | F | G | .
4 | H | | | | .
5 | I | J | | | .
.....
The challenge is that I don't know a priori how many rows or columns there will be. Those numbers are determined programatically, based on user input.
My only idea as of now is to do a series of nested loops and if statements, but I'm still trying to picture them all in my mind. I'm sure I can eventually figure this out, but is there another way that's easier? It's kind of like a transpose, but not completely.
Thanks for reading!
Last edited: