I am trying to make an outline for a sub that should be relatively simple, but I am stuck anyway.
In the sheet "Airports", there are two columns containing 5 letter airport codes. (Always 5 letters). "From Airport" is in col A, "To Airport" is in col b.
In the sheet "Conditions" there are 6 columns, the first two are airports, the remaining are general text. The number of rows will vary from time to time.Each cell in the two first columns may be either a airport code matching the airport codes in the first sheet, or it can be "ALL". ALL mean that the text in the same row should be written in for all airports, either both FROM and TO, or FROM a airport to ALL, or FROM ALL to a airport.
The sheet "Result" shows how the result should be.
I guess the way to do this is to loop thru the rows in the "Conditions", and then compare the airport codes with those in the sheet Airport codes", and if identical cells in a row is found a new row should be inserted, and the text pasted in.
The main question is how to handle situations when one (Either From or To is "ALL")
Anyone have a good idea on that?
In the sheet "Airports", there are two columns containing 5 letter airport codes. (Always 5 letters). "From Airport" is in col A, "To Airport" is in col b.
In the sheet "Conditions" there are 6 columns, the first two are airports, the remaining are general text. The number of rows will vary from time to time.Each cell in the two first columns may be either a airport code matching the airport codes in the first sheet, or it can be "ALL". ALL mean that the text in the same row should be written in for all airports, either both FROM and TO, or FROM a airport to ALL, or FROM ALL to a airport.
The sheet "Result" shows how the result should be.
I guess the way to do this is to loop thru the rows in the "Conditions", and then compare the airport codes with those in the sheet Airport codes", and if identical cells in a row is found a new row should be inserted, and the text pasted in.
The main question is how to handle situations when one (Either From or To is "ALL")
Anyone have a good idea on that?
ExampleWB.xlsx | |||
---|---|---|---|
G | |||
24 | |||
Condititions |