Loop with Multiple Conditions

Bercilak

Board Regular
Joined
Apr 11, 2007
Messages
50
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.










Excel Workbook
ABCDE
1TitlePrincipalMaturityDateCouponComponent
21992* *3,840,0008/15/20100.0540Serial
31992* *3,840,0008/15/20110.0540Serial
41992* *3,840,0008/15/20120.0540Serial
51996* * * * 35,0008/15/20110.0540Serial
61996* * * * 35,0008/15/20120.0540Serial
71996* * * * 40,0008/15/20130.0540Serial
81996* * * * 50,0008/15/20170.0538Term1
91996* * * * 50,0008/15/20180.0538Term1
101996* * * * 55,0008/15/20190.0538Term1
Sheet1
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,195,600
Messages
6,010,652
Members
441,558
Latest member
lambierules

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top