I'm currently working on a macro for a client and it involves the use of looping. Essentially what I want to do is find every instance where "EERT OUPUT" header is mentioned in the spreadsheet then rearrange the stacked data below the EERT OUTPUT header into one line or row then proceed to the next EERT OUTPUT header perform the same rearranging activities and so on and so forth. The problem is that the EERT OUTPUT sections aren't sequential AND I have an infinite loop and don't know how to exit. The first EERT OUTPUT header would be in cell A16, the three lines of data (covering about 10 columns) would be provided beneath the header, and then the next EERT OUTPUT header wouldn't be found until cell A112. So about every 100 rows or so the EERT OUTPUT header appears, but varies. I've tried a ton of different things with the VBA, but I think I reached the limitations of my knowledge. Here's the VBA I have:
Also, here's how the spreadsheet is arranged where each letter represents a different data field. I 've provided two additional output groups, but there's probably about 5 or 6 of them. I need to keep the headers, but what I want to do is take the stacked data that is on separate rows and place it on one row. So as you can see the search functionality was used in my macro because the EERT OUTPUT sections are spread out, which makes this macro more complex than your typically loop. So I want to find the first EERT OUTPUT, perform the reorganizing of the data, then move to the next EERT OUTPUT header, perform the same task, and continue until all EERT OUTPUT sections have been reorganized to meet the identified specifications. I also want to be able to continue the macro after exiting the loop and perform additional processes prior to the loop.
EERT OUTPUT
A B C D E F G H
I J K L M N O P
Q R S T U V W X
OUTPUT 1
AB AC AD AE AF
AG AH AI AJ AL
AM AN AO AP AQ
OUTPUT 2
BC BD BE BF BG
BH BI BJ BL BM
BN BO BP BQ BR
EERT OUTPUT
A B C D E F G H
I J K L M N O P
Q R S T U V W X
Any help is much appreciated!!!!!
Bookmarks