Sophie90
Gebruiker
- Lid geworden
- 4 nov 2011
- Berichten
- 46
Ik probeer mijn code op te ruimen, maar mijn kennis schiet te kort. Ik heb onderstaande code geprobeerd, maar krijg steeds een foutmelding. Wie kan mij de fout aanwijzen?
Code:
Sub UserForm_Initialize()
'Nieuwe code:
Dim i As Integer
For i = 1 To 30
Presentieform.Controls("TextBox" & i).Value = Worksheets("Herhalers").Range(Cells(6 + i, 2)).Value
Next i
'oude code:
'Presentieform.TextBox1.Value = Worksheets("Herhalers").[B7]
'Presentieform.TextBox2.Value = Worksheets("Herhalers").[B8]
'Presentieform.TextBox3.Value = Worksheets("Herhalers").[B9]
'Presentieform.TextBox4.Value = Worksheets("Herhalers").[B10]
'Presentieform.TextBox5.Value = Worksheets("Herhalers").[B11]
'Presentieform.TextBox6.Value = Worksheets("Herhalers").[B12]
'Presentieform.TextBox7.Value = Worksheets("Herhalers").[B13]
'Presentieform.TextBox8.Value = Worksheets("Herhalers").[B14]
'Presentieform.TextBox9.Value = Worksheets("Herhalers").[B15]
'Presentieform.TextBox10.Value = Worksheets("Herhalers").[B16]
'Presentieform.TextBox11.Value = Worksheets("Herhalers").[B17]
'Presentieform.TextBox12.Value = Worksheets("Herhalers").[B18]
'Presentieform.TextBox13.Value = Worksheets("Herhalers").[B19]
'Presentieform.TextBox14.Value = Worksheets("Herhalers").[B20]
'Presentieform.TextBox15.Value = Worksheets("Herhalers").[B21]
'Presentieform.TextBox16.Value = Worksheets("Herhalers").[B22]
'Presentieform.TextBox17.Value = Worksheets("Herhalers").[B23]
'Presentieform.TextBox18.Value = Worksheets("Herhalers").[B24]
'Presentieform.TextBox19.Value = Worksheets("Herhalers").[B25]
'Presentieform.TextBox20.Value = Worksheets("Herhalers").[B26]
'Presentieform.TextBox21.Value = Worksheets("Herhalers").[B27]
'Presentieform.TextBox22.Value = Worksheets("Herhalers").[B28]
'Presentieform.TextBox23.Value = Worksheets("Herhalers").[B29]
'Presentieform.TextBox24.Value = Worksheets("Herhalers").[B30]
'Presentieform.TextBox25.Value = Worksheets("Herhalers").[B31]
'Presentieform.TextBox26.Value = Worksheets("Herhalers").[B32]
'Presentieform.TextBox27.Value = Worksheets("Herhalers").[B33]
'Presentieform.TextBox28.Value = Worksheets("Herhalers").[B34]
'Presentieform.TextBox30.Value = Worksheets("Herhalers").[B35]
End Sub