coded approach
![]()
Sub X() Dim lngRow As Long Dim lngCol As Long Dim rngMatrix As Range Dim strOriginCity As String Dim strDestinationCity As String Set rngMatrix = Range("A1:F5") strOriginCity = Range("I3") strDestinationCity = Range("I4") lngRow = Application.Match(strOriginCity, rngMatrix.Columns(1), 0) lngCol = Application.Match(strDestinationCity, rngMatrix.Rows(1), 0) MsgBox "Value =" & rngMatrix(lngRow, lngCol) End Sub
Bookmarks