View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
aircraft_model VBA aircraft_model VBA is offline
external usenet poster
 
Posts: 5
Default Aircraft Scheduling Problem VBA code needs adjustment.

The code I used:

Sub Express()
For Each c In [J1:J35000]
Select Case c.Offset(0, 1).Text
Case Is = "CRJ", "EMB", "EMR"
c.Value = c.Value & IIf(Right(c.Text, 1) < "E", "E", "")
End Select
Next c
End Sub


The objective:

In 1 column of my worksheet, (i.e. Column J), I have a list of aircraft
types (B737, A320, CRJ, EMB, EMR, and so on). In another column, (i.e.
Column B), I have the corresponding Airline flying these aircraft (CO,
NW, DL, and so on). For each CRJ, or EMB, or EMR, in Column J, I would
like the corresponding cell in Column B to add letter "e" as a suffix.

Before the macro, lets assume, J2 has text CRJ and B2 has CO. After the
macro is run, J2 would continue to have CRJ as its contents, but B2
should be COE. The E would mean it is not just a continental airlines
flight, but a continental express flight.

Hope I clarified it somewhat at least, Thanks a million.






*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!