debayanganguly Beginner

  • Member since Jan 15th 2020
  • Last Activity:
Posts
2
Points
20
Profile Hits
85
  • 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, 8) = 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, 8)



    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