• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Index & Match Function Use By For Loop

delta

Member
i like when i select any value in ComboBox 1 and ComboBox 4 than rate is shown in only TextBox 1
if when select any value in ComboBox 2 and ComboBox 5 than rate is shown in only TextBox 2
if when select any value in ComboBox 3 and ComboBox 6 than rate is shown in only TextBox 3

but in my macro when select any value in ComboBox 1 and ComboBox 4 than rate is shown in 3 TextBox

>>> use code - tags as You ( delta ) have informed many time <<<
Code:
Dim i As Integer 'cover type combox
Dim x As Integer  ' center name combox
Dim k As Integer  ' amount combox

On Error Resume Next

Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""



For i = 1 To 3

For x = 4 To 6

For k = 1 To 3

Me.Controls("TextBox" & k).Value = Application.WorksheetFunction.Index(Sheet2.Range("A1:E8"), Application.WorksheetFunction.Match(Me.Controls("ComboBox" & i), Sheet2.Range("A1:A8"), 0), Application.WorksheetFunction.Match(Me.Controls("ComboBox" & x), Sheet2.Range("A1:E1"), 0))

Next

Next

Next

i attache the sample file
 

Attachments

  • V_Look_Up_For_Loop.xlsm
    26.9 KB · Views: 3
Last edited by a moderator:
Back
Top