Depending on the option of the combobox I want that in my text box show up the cell immediately below .
Example:
in cell j3 is the number 1 which show up in my combobox
i want that in my text box show up the value of the cell j4
the code that I use and works fine for the combobox is these
any ideas ?
Thank You
=============================================
Don't work at all
Private Sub ComboBox2_Change()
Dim i As Integer
Dim MyArray As Variant
MyArray = WorksheetFunction.Transpose(Worksheets("sheet1").Range("J3:AG3"))
For Each cell In MyArray
Me.TextBox18.Value = Me.ComboBox2(MyArray.Offset(1, 0))
Next
End Sub
====================================================================
'Works fine
Private Sub UserForm_Initialize()
Dim i As Integer
Dim MyArray As Variant
MyArray = WorksheetFunction.Transpose(Worksheets("sheet1").Range("J3:AG3"))
For Each cell In MyArray
Me.ComboBox2.AddItem (cell)
Next
ComboBox1.List = Array("Helena Soares Carneiro", "Jose Carlos Monteiro", "Alex Urtubia", "Gonçalo Alves", "Rui Baptista", "Carlos Pires")
End Sub
Bookmarks