From a VBS script I have to work with an Excel book with the format:
| A | B | C |
----|-----------|-----------|-----------|
1 | Header1 | Header2 | Header3 |
----|-----------|-----------|-----------|
2 | FOLDER1 | | |
----|-----------|-----------|-----------|
3 | Item1 | 111 | 222 |
----| |-----------|-----------|
4 | | Item1Info | Item1Data |
----| |-----------|-----------|
.. | | ... | ... |
----| |-----------|-----------|
11 | | 333 | 444 |
----|-----------|-----------|-----------|
12 | Item2 | 555 | 666 |
----|-----------|-----------|-----------|
13 | FOLDER2 | | |
----|-----------|-----------|-----------|
14 | Item1 | 777 | 888 |
----|-----------|-----------|-----------|
.. | ... | ... | ... |
So: Column A has 1st level and 2nd level categories (Folders/Items), and Columns B and C hold the data for the items. The trouble here is that one item can span several rows, as shown; Item1 is a merged cell from rows 3 to 11).
I need to create a .csv from this data that looks as follows:
Header1,Header2,Header3
111,Item1,FOLDER1
Item1Info,Item1,FOLDER1
...
555,Item2,FOLDER1
777,Item1,FOLDER2
...
The data in Column C can be discarded.
Basically, what I need to know is how to detect if a cell is merged (that is; more than one row of information per item) and how many rows are merged together. Any idea?