I’m hoping that I can explain this well enough.
I have an excel document which has been laid out as such;
A B C D ... n
1 [ ][ H ][ H ][ H ][ ... ][ H ]
2 [ ][ T ][ T ][ T ][ ... ][ T ]
3 [ C ][ D ][ D ][ D ][ ... ][ D ]
4 [ C ][ D ][ D ][ D ][ ... ][ D ]
5 [ C ][ D ][ D ][ D ][ ... ][ D ]
. [ ... ][ ... ][ ... ][ ... ][ ... ][ D ]
n [ C ][ D ][ D ][ D ][ D ][ D ]
H: Major header
T: Title
C: Side Header
D: Data (Some may also be blank)
I need to convert this into a format that can be utilised by a database. I know what I want to convert it to, but I do not know how to do it (with vba or any other alternative).
What I would like is;
A B C D
1 [ C ][ T ][ H ][ D ]
2 [ C ][ T ][ H ][ D ]
3 [ C ][ T ][ H ][ D ]
. [ ... ][ ... ][ ... ][ ... ]
n [ C ][ T ][ H ][ D ]
How I think it could be done is to loop through the viable region (all of the ‘Data’ represented as ‘D’), checking to make sure that is contains data in it (if not do not print that line), and then getting its respective headers and printing out the end products, either by overwriting the previous data or putting it onto a different sheet.
Thanks! Any help is appreciated.
here is a full working code (in my sample at least):