Peg
New member
- Joined
- May 10, 2021
- Messages
- 5
- Reaction score
- 0
- Points
- 0
- Excel Version(s)
- Windows 10
Hello, I am new to VBA and this forum. I am hoping someone has a moment to help me?
The macro, below, is executed by clicking one of three choices in a combobox. The combobox is linked to cell "L5". Each time one of the options (Turn, River, Other) is chosen, the result in cell "O14 is the same...the value from the last line executed under "Else".
I have tested the "Index" functions (one at a time) in the Master sheet formula bar, and the results were correct for each. Your time and assistance is appreciated.
The macro, below, is executed by clicking one of three choices in a combobox. The combobox is linked to cell "L5". Each time one of the options (Turn, River, Other) is chosen, the result in cell "O14 is the same...the value from the last line executed under "Else".
I have tested the "Index" functions (one at a time) in the Master sheet formula bar, and the results were correct for each. Your time and assistance is appreciated.
Code:
Sub StreetChoice()
'To match street choice to options
If Range("L5") = "Turn" Then
Range("O14").Value = "= Index(G58:G80,match(I6,E58:E80,0))"
ElseIf Range("L5") = "River" Then
Range("O14").Value = "= Index(H58:H80,match(I6,E58:E80,0))"
Else
Range("O14").Value = "= Index(I58:I80,match(I6,E58:E80,0))"
End If
End Sub
Last edited by a moderator: