do you see what I did in the below images? all of these checks:
?headerArr(n * 2)
B5
?Controls("TextBox" & (n + 1))
?n+1
1
?frmInputs.TextBo5
test value
?"TextBox" & (n + 1)
TextBox1
?Controls("TextBox1")
?frmInputs.Controls("TextBo5")
test value
you are doing:
?Controls("TextBox" & (n + 1))
which results as:
it seems that excel finds that invalid. try:
frmInputs.Controls("TextBox" & (n + 1))
as in image 3 below. you need a parent for textbox & (n+1). also, your code, IMO, is WAY too complex. the divisions and multiplications are not necessary whatsoever. it really should be a simple as this (common sense sample, not actual code):
dim array (control names of boxes in here)
dim c as long
for c = lbound(array) to ubound(array)
range(cell_address) = frmInputs.controls(array(c))
next c
Bookmarks