Is het mogelijk om in een "Array" de opmaak van de cellen te bepalen?
Zodat het gekleurde deel in de code niet moet ingetikt worden?
Zodat het gekleurde deel in de code niet moet ingetikt worden?
Code:
Private Sub CommandButton1_Click()
If ComboBox3.Value = "" Then
MsgBox "Je moet een plaats kiezen"
Exit Sub
End If
ar = Array(ComboBox3.Value, TextBox1.Value, TextBox2.Value, TextBox3.Value, TextBox4.Value, ComboBox2.Value, TextBox6.Value, _
TextBox5.Value, TextBox7.Value, TextBox8.Value, TextBox9.Value, TextBox10.Value, TextBox11.Value)
Sheets("Invoer").Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(, 13) = ar
[COLOR="#FF0000"]With Sheets("Invoer")
.Range("A:M").Columns.AutoFit
.Range("A:M").HorizontalAlignment = xlCenter[/COLOR]
[COLOR="#FF0000"]End With[/COLOR]