mountainman88
Board Regular
- Joined
- Jun 22, 2019
- Messages
- 109
- Office Version
- 2016
- Platform
- Windows
I would like an array that takes this table (i will call it TableA):
[TABLE="width: 406"]
<tbody>[TR]
[TD]GrandTotal[/TD]
[TD]Total1[/TD]
[TD]Total2[/TD]
[TD](empty cell)[/TD]
[TD]Total3[/TD]
[/TR]
[TR]
[TD]Total1[/TD]
[TD]Apples[/TD]
[TD]Beatles[/TD]
[TD][/TD]
[TD]Cats[/TD]
[/TR]
[TR]
[TD]Total2[/TD]
[TD]Bananas[/TD]
[TD]Stones[/TD]
[TD][/TD]
[TD]Who[/TD]
[/TR]
[TR]
[TD]Total3[/TD]
[TD]Cherries[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 331"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
(would ideally like a msgbox to ask the sheetname and first cell of where TableA is located)
and turns TableA into a 2d array called 'TableA' where:
Row 1 of the array is the TableA contents sorted as follows:
[TABLE="width: 663"]
<tbody>[TR]
[TD="class: xl65, width: 76"]GrandTotal[/TD]
[TD="class: xl65, width: 51"]Total1[/TD]
[TD="width: 47"]Apples[/TD]
[TD="width: 57"]Bananas[/TD]
[TD="width: 57"]Cherries[/TD]
[TD="class: xl65, width: 51"]Total2[/TD]
[TD="width: 51"]Beatles[/TD]
[TD="width: 51"]Stones[/TD]
[TD="class: xl65, width: 51"](empty)[/TD]
[TD="class: xl65, width: 51"]Total3[/TD]
[TD="width: 51"]Cats[/TD]
[TD="width: 69"]Who[/TD]
[/TR]
</tbody>[/TABLE]
(Notice any items already in the top row of TableA are ignored and not duplicated when in the format above)
and
Row 2 of the array contains:
- 'total' if the row 1 array item is on the top of TableA eg. 'GrandTotal, Total1 etc'
- 'data' if the row 1 array item is NOT on the top row of TableA
- 'blank' if the row 1 array item is empty (ie left a blank column in TableA) like between stones and Total3
I would like the array to exclude any other 'blanks' eg under Stones or Who. Just include the 'blanks' in the top row of TableA..
The array should look like this:
[TABLE="width: 663"]
<tbody>[TR]
[TD]GrandTotal[/TD]
[TD]Total1[/TD]
[TD]Apples[/TD]
[TD]Bananas[/TD]
[TD]Cherries[/TD]
[TD]Total2[/TD]
[TD]Beatles[/TD]
[TD]Stones[/TD]
[TD](empty)[/TD]
[TD]Total3[/TD]
[TD]Cats[/TD]
[TD]Who[/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD]Total[/TD]
[TD]Data[/TD]
[TD]Data[/TD]
[TD]Data[/TD]
[TD]Total[/TD]
[TD]Data[/TD]
[TD]Data[/TD]
[TD]Blank[/TD]
[TD]Total[/TD]
[TD]Data[/TD]
[TD]Data[/TD]
[/TR]
</tbody>[/TABLE]
hope this makes sense, should test you guys ha
[TABLE="width: 406"]
<tbody>[TR]
[TD]GrandTotal[/TD]
[TD]Total1[/TD]
[TD]Total2[/TD]
[TD](empty cell)[/TD]
[TD]Total3[/TD]
[/TR]
[TR]
[TD]Total1[/TD]
[TD]Apples[/TD]
[TD]Beatles[/TD]
[TD][/TD]
[TD]Cats[/TD]
[/TR]
[TR]
[TD]Total2[/TD]
[TD]Bananas[/TD]
[TD]Stones[/TD]
[TD][/TD]
[TD]Who[/TD]
[/TR]
[TR]
[TD]Total3[/TD]
[TD]Cherries[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 331"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
(would ideally like a msgbox to ask the sheetname and first cell of where TableA is located)
and turns TableA into a 2d array called 'TableA' where:
Row 1 of the array is the TableA contents sorted as follows:
[TABLE="width: 663"]
<tbody>[TR]
[TD="class: xl65, width: 76"]GrandTotal[/TD]
[TD="class: xl65, width: 51"]Total1[/TD]
[TD="width: 47"]Apples[/TD]
[TD="width: 57"]Bananas[/TD]
[TD="width: 57"]Cherries[/TD]
[TD="class: xl65, width: 51"]Total2[/TD]
[TD="width: 51"]Beatles[/TD]
[TD="width: 51"]Stones[/TD]
[TD="class: xl65, width: 51"](empty)[/TD]
[TD="class: xl65, width: 51"]Total3[/TD]
[TD="width: 51"]Cats[/TD]
[TD="width: 69"]Who[/TD]
[/TR]
</tbody>[/TABLE]
(Notice any items already in the top row of TableA are ignored and not duplicated when in the format above)
and
Row 2 of the array contains:
- 'total' if the row 1 array item is on the top of TableA eg. 'GrandTotal, Total1 etc'
- 'data' if the row 1 array item is NOT on the top row of TableA
- 'blank' if the row 1 array item is empty (ie left a blank column in TableA) like between stones and Total3
I would like the array to exclude any other 'blanks' eg under Stones or Who. Just include the 'blanks' in the top row of TableA..
The array should look like this:
[TABLE="width: 663"]
<tbody>[TR]
[TD]GrandTotal[/TD]
[TD]Total1[/TD]
[TD]Apples[/TD]
[TD]Bananas[/TD]
[TD]Cherries[/TD]
[TD]Total2[/TD]
[TD]Beatles[/TD]
[TD]Stones[/TD]
[TD](empty)[/TD]
[TD]Total3[/TD]
[TD]Cats[/TD]
[TD]Who[/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD]Total[/TD]
[TD]Data[/TD]
[TD]Data[/TD]
[TD]Data[/TD]
[TD]Total[/TD]
[TD]Data[/TD]
[TD]Data[/TD]
[TD]Blank[/TD]
[TD]Total[/TD]
[TD]Data[/TD]
[TD]Data[/TD]
[/TR]
</tbody>[/TABLE]
hope this makes sense, should test you guys ha