I have been stumped over this process and had posted a question, which turned out to be the wrong question to ask. The table below is processed with the following code (abbreviated):
Do
'Setup a table based on the Title Column
Do
'Setup a subtable within the Title table based on the Component columnn
Do
'Add the data to the subtable
Loop While (Range("E" & y).Value) = (Range("E" & y - 1).Value) 'do while component is same
Loop While (Range("A" & y).Value) = (Range("A" & y - 1).Value) 'do while Title column is the same
'Save
Loop While (Not (Range("AF" & y).Value) = "") 'do until Title is blank
The problem is that I really need to check multiple conditions. For instance within each Title series, there can be different Components, however with this code, it doesnt think it is a new Title until it hits the Term1 component.
Can you add an OR statement to a loop? I have tried but am having no luck.
Do
'Setup a table based on the Title Column
Do
'Setup a subtable within the Title table based on the Component columnn
Do
'Add the data to the subtable
Loop While (Range("E" & y).Value) = (Range("E" & y - 1).Value) 'do while component is same
Loop While (Range("A" & y).Value) = (Range("A" & y - 1).Value) 'do while Title column is the same
'Save
Loop While (Not (Range("AF" & y).Value) = "") 'do until Title is blank
The problem is that I really need to check multiple conditions. For instance within each Title series, there can be different Components, however with this code, it doesnt think it is a new Title until it hits the Term1 component.
Can you add an OR statement to a loop? I have tried but am having no luck.
Excel Workbook | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Title | Principal | MaturityDate | Coupon | Component | ||
2 | 1992 | * *3,840,000 | 8/15/2010 | 0.0540 | Serial | ||
3 | 1992 | * *3,840,000 | 8/15/2011 | 0.0540 | Serial | ||
4 | 1992 | * *3,840,000 | 8/15/2012 | 0.0540 | Serial | ||
5 | 1996 | * * * * 35,000 | 8/15/2011 | 0.0540 | Serial | ||
6 | 1996 | * * * * 35,000 | 8/15/2012 | 0.0540 | Serial | ||
7 | 1996 | * * * * 40,000 | 8/15/2013 | 0.0540 | Serial | ||
8 | 1996 | * * * * 50,000 | 8/15/2017 | 0.0538 | Term1 | ||
9 | 1996 | * * * * 50,000 | 8/15/2018 | 0.0538 | Term1 | ||
10 | 1996 | * * * * 55,000 | 8/15/2019 | 0.0538 | Term1 | ||
Sheet1 |