seattletimebandit
Board Regular
- Joined
- Apr 11, 2013
- Messages
- 69
Hello!
Trying to figure out how to take a table of data and split into individual smaller tables. The source data table columns and rows are variable, from a few columns/rows to quite a lot, so maybe a message box asking user to select Range?
or something like:
Dim c1 As Range
Dim c2 As Range
lastColumn = ActiveSheet.Cells(c1.Row, Columns.Count).End(xlToLeft).Column
For Each c2 In Range(Cells(c1.Row, 3), Cells(c1.Row, lastColumn)).
Start with User pasting the Source Data Table starting in Cell B2 (which is empty):
Source Data Table:
<tbody>
</tbody>
Smaller tables output, can start one row down from source table for spacing(Note the column header moves to the left in Column B):
<tbody>
</tbody>
and so on..until entire Source Data Table has been split up.
Thoughts? Scripting.Dictionary? Not well versed in that complex coding, but have seen it work well on something similar, I just can get my head around tweaking the code I have to apply here.
Thanks! Russell
Trying to figure out how to take a table of data and split into individual smaller tables. The source data table columns and rows are variable, from a few columns/rows to quite a lot, so maybe a message box asking user to select Range?
or something like:
Dim c1 As Range
Dim c2 As Range
lastColumn = ActiveSheet.Cells(c1.Row, Columns.Count).End(xlToLeft).Column
For Each c2 In Range(Cells(c1.Row, 3), Cells(c1.Row, lastColumn)).
Start with User pasting the Source Data Table starting in Cell B2 (which is empty):
Source Data Table:
[Cell B2] | 322-H7 | 323-H7 | 324-G8 | 325-C11 | 326-E10 | 327-E10 |
Benzene | 0.00829 U | 0.00717 U | 0.00806 U | 0.0077 U | 0.0082 U | 0.00797 U |
Toluene | 0.0237 U | 0.0205 U | 0.0231 U | 0.022 U | 0.0235 U | 0.0228 U |
Ethylbenzene | 0.0297 U | 0.0257 U | 0.0288 U | 0.0276 U | 0.0293 U | 0.0285 U |
mp-Xylene | 0.0593 U | 0.0513 U | 0.0577 U | 0.0551 U | 0.0587 U | 0.0571 U |
o-Xylene | 0.0297 U | 0.0257 U | 0.0288 U | 0.0276 U | 0.0293 U | 0.0285 U |
Gasoline | 5.93 U | 5.13 U | 5.77 U | 5.51 U | 5.87 U | 5.71 U |
<tbody>
</tbody>
Smaller tables output, can start one row down from source table for spacing(Note the column header moves to the left in Column B):
322-H7 | |
Benzene | 0.00829 U |
Toluene | 0.0237 U |
Ethylbenzene | 0.0297 U |
mp-Xylene | 0.0593 U |
o-Xylene | 0.0297 U |
Gasoline | 5.93 U |
<tbody>
</tbody>
and so on..until entire Source Data Table has been split up.
Thoughts? Scripting.Dictionary? Not well versed in that complex coding, but have seen it work well on something similar, I just can get my head around tweaking the code I have to apply here.
Thanks! Russell