Here's the code.
with sdlc I count the number of columns in use. The number of rows with boxes is j (1 to sdlc - 1 [ first column not relevant]).
What i want is some sort of update where firstcol j + secondcol j = thirdcol j.
Sub boxes(formname)
On Error Resume Next
Dim ws As Worksheet
Dim j As Integer
Set ws = ThisWorkbook.Sheets("sheet1")
sdlc = ws.Cells(1, Columns.Count).End(xlToLeft).Column
For j = 1 To (sdlc - 1)
With formname.MultiPage1.page3.Controls.Add("Forms.textbox.1", "firstcol" & j, True)
.Top = (25 * j) + 20
.Left = 12
End With
Next j
For j = 1 To (sdlc - 1)
With formname.MultiPage1.page3.Controls.Add("Forms.textbox.1", "secondcol" & j, True)
.Top = (25 * j) + 20
.Left = formname.Controls("firstcol" & j).Width + 24
End With
Next j
For j = 1 To (sdlc - 1)
With formname.MultiPage1.page3.Controls.Add("Forms.textbox.1", "thirdcol" & j, True)
.Top = (25 * j) + 20
.Left = formname.Controls("firstcol" & j).Width + formname.Controls("secondcol" & j).Width + 36
End With
Next j
End Sub
Bookmarks