Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
Would someone be lomd enough to provide a solution to a hurdle I have encountered in my code?
Here is a snippet of that code. It works, no errors, but is failing to provide the finished results I seek/
I have a userform with 5 textboxes, tb_cu2_nm, tb_cu3_nm, tb_cu4_nm, tb_cu5_nm and tb_cu6_nm.
The code above uses an index/match formula to seek the name associated withthe particular lookup value from the array ... either CU2, CU3, CU4, CU5 or CU6.
Once that value is acquired, it is to populate the appropriate textbox (ie tb_cu2_nm with CU2, tb_cu3_nm with CU3 and tb_cu4_nm with CU4 and so on)
I've managed to figure it out for tb_cu2_nm, but I don't know how to change the object value in blue to reflect the object change. (ie to tb_cu3_nm etc).
Anyone?
Here is a snippet of that code. It works, no errors, but is failing to provide the finished results I seek/
Rich (BB code):
With MultiPage4
arrCtrls = Array("CU2", "CU3", "CU4", "CU5", "CU6")
For i = LBound(arrCtrls) To UBound(arrCtrls)
valLookup = arrCtrls(i)
st9 = WorksheetFunction.VLookup(valLookup, drng, 12, False)
Set ws_st = swb.Worksheets(st9)
.tb_cu2_nm.Value = WorksheetFunction.index(ws_lists.Range("BR2:BR25"), WorksheetFunction.Match(valLookup, ws_lists.Range("BT2:BT25"), 0))
Next i
End With
I have a userform with 5 textboxes, tb_cu2_nm, tb_cu3_nm, tb_cu4_nm, tb_cu5_nm and tb_cu6_nm.
The code above uses an index/match formula to seek the name associated withthe particular lookup value from the array ... either CU2, CU3, CU4, CU5 or CU6.
Once that value is acquired, it is to populate the appropriate textbox (ie tb_cu2_nm with CU2, tb_cu3_nm with CU3 and tb_cu4_nm with CU4 and so on)
I've managed to figure it out for tb_cu2_nm, but I don't know how to change the object value in blue to reflect the object change. (ie to tb_cu3_nm etc).
Anyone?
Last edited: