Results 1 to 4 of 4

Coding Problem

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-31-2009
    Location
    Halstead
    MS-Off Ver
    Excel 365
    Posts
    240

    Coding Problem

    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
    Last edited by Shazz; 02-03-2012 at 06:29 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1