A colleague created the following within a Macro...
If ActiveCell.Offset(0, 4) = "Altran GmbH & Co KG" Or ActiveCell.Offset(0, 4) = "SOCATA S.A.S." Or ActiveCell.Offset(0, 4) = "ALTEN" Or ActiveCell.Offset(0, 4) = "LABINAL GMBH" Or ActiveCell.Offset(0, 4) = "Spirit Aerosystems E" Or ActiveCell.Offset(0, 4) = "ALTRAN INNOVACION S." Then
'
If InStr((ActiveCell.Offset(0, 3).Value), "airbus") Or InStr((ActiveCell.Offset(0, 3).Value), "Airbus") Or InStr((ActiveCell.Offset(0, 3).Value), "external") Or InStr((ActiveCell.Offset(0, 4).Value), "AEROTEC") Or InStr((ActiveCell.Offset(0, 3).Value), "AEROLIA") Then
'
ActiveCell.Offset(0, 7).Select
ActiveCell.Value = "E1-EU"
ActiveCell.Offset(0, -7).Select
'
Else
ActiveCell.Offset(0, 7).Select
ActiveCell.Value = "EE-EU"
ActiveCell.Offset(0, -7).Select
End If
This Macro is kept in another file seperate to the data.
My colleague was expecting not to have to add lots more or conditions to the first line. Now, as you can tell, its grown to the point where we should have a list of company names on a seperate worksheet for maintainability.
I have pulled all the company names into a worksheet within the file containing the data (.sheet17 fyi). That list is now in the A column of the new worksheet.
What I can't for the life of me code is how to just check if the activecell.offset(0, 4) is matched anywhere in .sheet17 column A of that other worksheet.
Ideas anybody?
Bookmarks