theopract
02-28-2008, 02:38 PM
I wonder if someone could help me to execute such a code using application.evaluate:
ComboBox3.AddItem "text"
where "3" is a variable (for example: Dim d As Integer) and text is text in a cell (for example: CStr(Range(Index(z) + LTrim(str(j)))) )
p.s. I tried to write it different ways, but everywhere faild, for instance:
application.evaluate ("UserForm1.ComboBox" + Trim(str(d + 1)) + ".AddItem " + Chr(34) + CStr(Range(Index(z + 1) + LTrim(str(j)))) + Chr(34))
ComboBox3.AddItem "text"
where "3" is a variable (for example: Dim d As Integer) and text is text in a cell (for example: CStr(Range(Index(z) + LTrim(str(j)))) )
p.s. I tried to write it different ways, but everywhere faild, for instance:
application.evaluate ("UserForm1.ComboBox" + Trim(str(d + 1)) + ".AddItem " + Chr(34) + CStr(Range(Index(z + 1) + LTrim(str(j)))) + Chr(34))