Hi
.
You will have to save your file as an Excel Macro file.
.
Then you will have to add a module for putting code in.
.
Note: There are general modules and Class modules.
You want to add a General module in that the code below
is for a general module.
.
Based on your original Excel file I have made the assumption that all data
blocks begin with the word GROUP e.g. Group A , Group B etc.
.
If that assumption is NOT true then the code below will fail.
.
Please note the following about the code below:
* Alot of it will seem like gibberish. Just ignore most of it and look for a
subroutine called PUBLIC SUB MAIN. Once you have found it - put your
cursor in it and run it using the F8 key or the Shift F8 to by pass going into
lower sub routines.
* It is "more correct" to use local variables in a sub-routine but I not done this
and created properties for various counts and other thingies. They are being
used in place of local variables.
* I tested the code by (1) using what you had and (2) adding additional GROUPS
with various # of blank lines between them and the code seems to work,
.
BUT - the code assumes that the KEY WORD GROUP is **always** there
and **always** in the 1st column.
* This code is NOT elegant or the fastest way to do it - but its the way
I think. -g-
.
Just copy and paste the code below into the module I described above.
.
As in your example - I ASSUME data is in SHEET1 and you want to
write to SHEET2. (You can change this in the code if required)
.
HTH
regards
John
Bookmarks