Option Explicit
Sub indexANDmatch_Assistant()
Dim myrange As range
Dim selected As String
Dim I As String
Dim lastrow As String
Dim myrange2 As range
Dim answer As String
Dim myrange3 As range
Dim myrange4 As range
Dim cell As range
Dim myrange5 As String
Dim range As range
Dim MYRANGE7 As range
Dim MYRANGE6 As range
Dim tes As range
Set myrange = Application.InputBox("Select Index range", "Select Range", Type:=8)
'MYRANGE7 = range(myrange & Rows.Count).End(xlUp).Row
If myrange Is Nothing Then
'range is blank
Else
myrange.Select
End If
'answer = MsgBox("Do you want to select the entire used rows", vbYesNo, "Range Selection")
'If answer = vbYes Then
'Range(Selection, Selection.End(xlDown)).Select
Set myrange2 = Application.InputBox("Select Match Type", "Select Array", Type:=8)
If myrange2 Is Nothing Then
'range is blank
Else
myrange2.Select
End If
Set myrange3 = Application.InputBox("Select Match Array", "Select Range", Type:=8)
If myrange3 Is Nothing Then
'range is blank
Else
myrange3.Select
'range(Selection, Selection.End(xlDown)).Select
End If
myrange5 = Application.InputBox("Select Text", "Wrtie Text", Type:=0)
Set myrange4 = Application.InputBox("Select Result range", "Select Range", Type:=8)
If myrange4 Is Nothing Then
'range is blank
Else
myrange4.Select
'range(Selection, Selection.End(xlDown)).Select
Selection.Formula = Application.WorksheetFunction.Index(myrange, Application.WorksheetFunction.Match(myrange2, myrange3, 0))
End If
'If answer = vbNo Then
'NOTHING
'End If
End Sub