Here's my code:
Now, here's my problem:![]()
Private Sub AmendOK_Click() Dim rowindex As Integer rowcount = Sheet2.Rows.Count If rowcount > 2500 Then rowcount = 2500 For x = 2 To rowcount If Sheets(2).Cells(x, 1) = txtTraineeName And Sheets(2).Cells(x, 5) = CDate(txtWeekEndingDate) Then rowindex = x x = rowcount End If Next x Sheets(2).Cells(rowindex, 1).Value = txtTraineeName.Value txtTraineeName.Value = Sheets(2).Cells(rowindex, 1).Value Sheets(2).Cells(rowindex, 5).Value = txtWeekEndingDate.Value txtWeekEndingDate.Value = Sheets(2).Cells(rowindex, 5).Value Sheets(2).Cells(rowindex, 10).Value = txtOOEAchieved.Value txtOOEAchieved.Value = Sheets(2).Cells(rowindex, 10).Value Sheets(2).Cells(rowindex, 11).Value = txtOOETarget.Value txtOOETarget.Value = Sheets(2).Cells(rowindex, 11).Value Sheets(2).Cells(rowindex, 12).Value = txtWRAchieved.Value txtWRAchieved.Value = Sheets(2).Cells(rowindex, 12).Value Sheets(2).Cells(rowindex, 13).Value = txtWRTarget.Value txtWRTarget.Value = Sheets(2).Cells(rowindex, 13).Value Sheets(2).Cells(rowindex, 14).Value = txtQCAchieved.Value txtQCAchieved.Value = Sheets(2).Cells(rowindex, 14).Value Sheets(2).Cells(rowindex, 15).Value = txtQCTarget.Value txtQCTarget.Value = Sheets(2).Cells(rowindex, 15).Value Sheets(2).Cells(rowindex, 17).Value = txtTrainerOOEAchieved.Value txtTrainerOOEAchieved.Value = Sheets(2).Cells(rowindex, 17).Value Sheets(2).Cells(rowindex, 18).Value = txtTrainerOOETarget.Value txtTrainerOOETarget.Value = Sheets(2).Cells(rowindex, 18).Value Sheets(2).Cells(rowindex, 19).Value = txtTrainerWRAchieved.Value txtTrainerWRAchieved.Value = Sheets(2).Cells(rowindex, 19).Value Sheets(2).Cells(rowindex, 20).Value = txtTrainerWRTarget.Value txtTrainerWRTarget.Value = Sheets(2).Cells(rowindex, 20).Value Unload AmendData End Sub
The part of the code that is populating my Userform with the contents of column 17 (txtTrainerOOEAchieved) is actually populating with the data from column 16. I have looked and looked and looked at it for the whole morning but cannot see what is wrong with it.
Please help. I have to present this in 2 hours and it's the only bit that's not working now.
Thanks from a desperate me.











LinkBack URL
About LinkBacks
Register To Reply
Bookmarks