Hello and thank you for offering your help.
I have 2 columns I have to compare and match. Cities and Airport Codes
Each column is user defined (input by user, not pulled out of a static environment/system) which adds some tricky coding.
1. There are over 200 airport codes in this particular report (probably not a great idea to write CASE, CASE ELSE code in this circumstance).
2. Each column is user defined, so if I am going to match, for example, MSP to MINNEAPOLIS, I have to account for people who define the city as "Minneapolis, MINNEAPOLIS, Minneapolis-St. Paul, Minneapolis-Saint Paul, Saint Paul, Minneapolis/St.Paul" etc. etc. etc.
3. Once I match MSP with one of its many forms of corresponding city definitions, I need "mycell" to return "True"
I've seen some code that is way over my head, but was wondering if it shows any promise or if you all have a better idea? Pull the codes and cities out of a table? But then how does one account for the multiple ways a user can define the city?
Here's part the "Way over my head" code:
Don't ask me about the code... I have no clue, but if any of you Excel MVPs, Pro and kings of coding can help, I'd be grateful. Thanks.
I have 2 columns I have to compare and match. Cities and Airport Codes
Each column is user defined (input by user, not pulled out of a static environment/system) which adds some tricky coding.
1. There are over 200 airport codes in this particular report (probably not a great idea to write CASE, CASE ELSE code in this circumstance).
2. Each column is user defined, so if I am going to match, for example, MSP to MINNEAPOLIS, I have to account for people who define the city as "Minneapolis, MINNEAPOLIS, Minneapolis-St. Paul, Minneapolis-Saint Paul, Saint Paul, Minneapolis/St.Paul" etc. etc. etc.
3. Once I match MSP with one of its many forms of corresponding city definitions, I need "mycell" to return "True"
I've seen some code that is way over my head, but was wondering if it shows any promise or if you all have a better idea? Pull the codes and cities out of a table? But then how does one account for the multiple ways a user can define the city?
Here's part the "Way over my head" code:
Code:
'Dim acrArray
'Dim mycell As Range
'Dim myrange As Range
'acrArray = Array("ATG", "MSP", "DTW", "")
'For Each mycell In Range("V2", Range("V" & Rows.Count).End(xlUp))
'For Each myrange In Range("A2", Range("A" & Rows.Count).End(xlUp))
'For i = LBound(acrArray) To UBound(acrArray)
' If (StrComp(mycell, acrArray(i)) + StrComp(myrange, acrArray(i)) > 0) Then
' mycell.Value = "True"
' i = UBound(acrArray) + 1
' End If
'Next i
'Next myrange
'Next mycell
Don't ask me about the code... I have no clue, but if any of you Excel MVPs, Pro and kings of coding can help, I'd be grateful. Thanks.
Last edited: