NessPJ
Active Member
- Joined
- May 10, 2011
- Messages
- 420
- Office Version
- 365
Hello,
I have a sheet with data obtained from somewhere else using VBA.
I would like to make VBA code to sum, some of these results together if the user has configured which cells relate to each other. For example:
<tbody>
</tbody>
In the example the table has been configured to make Row 14 and Row 16 have a relationship with Row 10 meaning the Data from Rows 10, 14 and 16 is summed together.
Is it possible to do this?
A limitation would be that a Row can only have a single relationship defined (but thats okay).
Inside the entire table, multiple different relationships should be possible though (some could have only 2 rows defined, while others could for example have 8).
I tried to think of a way how to do this, but i get stuck because i think i need to make a new variable in VBA which is automatically created each time a relationship is found, to sum them all up afterwards?
I didn't know how to proceed there with that.
I have a sheet with data obtained from somewhere else using VBA.
I would like to make VBA code to sum, some of these results together if the user has configured which cells relate to each other. For example:
Excel Row Number | Data | Relationship to Row | End Result |
10 | 5 | 18 | |
11 | 41 | 41 | |
12 | 7 | 7 | |
13 | 99 | 99 | |
14 | 2 | 10 | 2 |
15 | 23 | 23 | |
16 | 11 | 10 | 11 |
17 | 56 | 56 | |
18 | 20 | 20 |
<tbody>
</tbody>
In the example the table has been configured to make Row 14 and Row 16 have a relationship with Row 10 meaning the Data from Rows 10, 14 and 16 is summed together.
Is it possible to do this?
A limitation would be that a Row can only have a single relationship defined (but thats okay).
Inside the entire table, multiple different relationships should be possible though (some could have only 2 rows defined, while others could for example have 8).
I tried to think of a way how to do this, but i get stuck because i think i need to make a new variable in VBA which is automatically created each time a relationship is found, to sum them all up afterwards?
I didn't know how to proceed there with that.
Last edited: