Hi All,
I have the below code which worked fine, I have added and subtracted some boxes ComboBoxes, but now the code does not work, please could you have a look at the code to see what is wrong.
Sub LoadData(SelRow)
With Data
If SelRow < 1 Or SelRow > .Cells(.Rows.Count, 1).End(xlUp).Row Then
Label13.Visible = True
Exit Sub
End If
Label13.Visible = False
For col = 1 To 12
Controls("TextBox" & col).Value = .Cells(SelRow, col).Value
Next col
For col = 13 To 20
Controls("ComboBox" & col).Value = .Cells(SelRow, col).Value
Next col
ComboBox13.Value = .Cells(SelRow, 13).Value
TextBox24.Value = .Cells(SelRow, 14).Value
InstallDate.Value = .Cells(SelRow, 15).Value
TextBox15.Value = .Cells(SelRow, 16).Value
TextBox13.Value = .Cells(SelRow, 17).Value
ComboBox15.Value = .Cells(SelRow, 18).Value
TextBox25.Value = .Cells(SelRow, 19).Value
InstallDate2.Value = .Cells(SelRow, 20).Value
TextBox16.Value = .Cells(SelRow, 21).Value
CheckDueDate2.Value = .Cells(SelRow, 22).Value
ComboBox17.Value = .Cells(SelRow, 23).Value
TextBox26.Value = .Cells(SelRow, 24).Value
InstallDate3.Value = .Cells(SelRow, 25).Value
TextBox17.Value = .Cells(SelRow, 26).Value
CheckDueDate3 = .Cells(SelRow, 27).Value
ComboBox19.Value = .Cells(SelRow, 28).Value
TextBox27.Value = .Cells(SelRow, 29).Value
TextBox18.Value = .Cells(SelRow, 30).Value
TextBox21.Value = .Cells(SelRow, 31).Value
TextBox20.Value = .Cells(SelRow, 32).Value
ComboBox20.Value = .Cells(SelRow, 33).Value
TextBox28.Value = .Cells(SelRow, 34).Value
TextBox19.Value = .Cells(SelRow, 35).Value
TextBox22.Value = .Cells(SelRow, 36).Value
TextBox23.Value = .Cells(SelRow, 37).Value
TextBox14.Value = .Cells(SelRow, 38).Value
End With
End Sub
Thanks
Shazz
xx
Bookmarks