Could someone to solve this code as it is not working correctly.
Private Sub CommandButton1_Click()
Dim Ssheet, Tsheet As Worksheet
Dim Srow, Trow As Long
Dim Curr_PEW
Set Ssheet = ThisWorkbook.Worksheets("BT_Activity_Tracker_FPWT")
Set Tsheet = ThisWorkbook.Worksheets("Sheet2")
Trow = 2
While Tsheet.Cells(Trow, 2) <> ""
Curr_PEW = Tsheet.Cells(Trow, 2)
Srow = 4
Do While Ssheet.Cells(Srow, 5) <> ""
If Curr_PEW = Ssheet.Cells(Srow, 5) And Trim(UCase(Ssheet.Cells(Srow, 14))) <> "WIP" Then
Tsheet.Cells(Trow, 3) = Ssheet.Cells(Srow, 6)
Ssheet.Cells(Srow, 14) = Tsheet.Cells(Trow, 4)
Ssheet.Cells(Srow, = Tsheet.Cells(Trow, 1)
Ssheet.Cells(Srow, 15) = Tsheet.Cells(Trow, 6)
Ssheet.Cells(Srow, 16) = Tsheet.Cells(Trow, 7)
Ssheet.Cells(Srow, 17) = Tsheet.Cells(Trow,
Tsheet.Cells(Trow, 5) = Ssheet.Cells(Srow, 9) ' Scheduled Date
Tsheet.Cells(Trow, 9) = Ssheet.Cells(Srow, 20) ' Remarks
Exit Do
End If
Srow = Srow + 1
Loop
Trow = Trow + 1
Wend
MsgBox "Tracker has been updated successfully........."
End Sub
debayanganguly
Could someone to solve this code as it is not working correctly.
Private Sub CommandButton1_Click()
Dim Ssheet, Tsheet As Worksheet
Dim Srow, Trow As Long
Dim Curr_PEW
Set Ssheet = ThisWorkbook.Worksheets("BT_Activity_Tracker_FPWT")
Set Tsheet = ThisWorkbook.Worksheets("Sheet2")
Trow = 2
While Tsheet.Cells(Trow, 2) <> ""
Curr_PEW = Tsheet.Cells(Trow, 2)
Srow = 4
Do While Ssheet.Cells(Srow, 5) <> ""
If Curr_PEW = Ssheet.Cells(Srow, 5) And Trim(UCase(Ssheet.Cells(Srow, 14))) <> "WIP" Then
Tsheet.Cells(Trow, 3) = Ssheet.Cells(Srow, 6)
Ssheet.Cells(Srow, 14) = Tsheet.Cells(Trow, 4)
Ssheet.Cells(Srow,
= Tsheet.Cells(Trow, 1)
Ssheet.Cells(Srow, 15) = Tsheet.Cells(Trow, 6)
Ssheet.Cells(Srow, 16) = Tsheet.Cells(Trow, 7)
Ssheet.Cells(Srow, 17) = Tsheet.Cells(Trow,
Tsheet.Cells(Trow, 5) = Ssheet.Cells(Srow, 9) ' Scheduled Date
Tsheet.Cells(Trow, 9) = Ssheet.Cells(Srow, 20) ' Remarks
Exit Do
End If
Srow = Srow + 1
Loop
Trow = Trow + 1
Wend
MsgBox "Tracker has been updated successfully........."
End Sub