Procedure Too Large

cklim01

New Member
Joined
Nov 18, 2015
Messages
5
I have simple but long code as below. I am getting error saying that "Procedure too large". Can someone tell me how to make it shorter or split it? Appreciate and thanks in advance.

Code:
Option Explicit
Private Sub cmdCancel_Click()
    Unload Me
End Sub


Private Sub cmdOK_Click()


Dim LColumn As Integer, Acolumn As Integer, i As Integer, LRow As Integer, a As Integer, b As Integer, AA As Integer, BB As Integer
Dim WeekNoRng As Range, OpenWORng As Range


'Prompt message box when week number is empty
    If Me.txtWeekNo.Value = "" Then
        MsgBox "Please enter week number to print.", vbExclamation, "Print Work Order by Schedule"
        Me.txtWeekNo.SetFocus
        Exit Sub
    End If
    
'Check for valid week number
LColumn = Worksheets("RIG PMS").Cells(5, Worksheets("RIG PMS").Columns.Count).End(xlToLeft).Column 'Define last column in week number
Set WeekNoRng = Worksheets("RIG PMS").Range(Cells(5, 10), Cells(5, LColumn))
    If WorksheetFunction.CountIf(WeekNoRng, txtWeekNo.Value) = 0 Then
         MsgBox "Invalid Week Number"
         Exit Sub
        Else
            Unload frmPrintWOSch
    End If
    
'Determine column
        For i = 10 To LColumn
            If WorksheetFunction.CountIf(Worksheets("RIG PMS").Cells(5, i), txtWeekNo.Value) > 0 Then
                Acolumn = i
            End If
        Next i
        
LRow = Worksheets("RIG PMS").Cells(Rows.Count, "I").End(xlUp).Row
Set OpenWORng = Worksheets("Open WO").Range("B3:B" & Worksheets("Open WO").Range("B" & Rows.Count).End(xlUp).Row)


    For a = 7 To LRow Step 3
        AA = 0
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 1 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Power Pack Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Power Pack Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Power Pack Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Power Pack Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 2 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Power Pack 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Power Pack 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Power Pack 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Power Pack 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 3 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Mud Pump Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Mud Pump Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Mud Pump Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Mud Pump Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 4 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Mud Pump 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Mud Pump 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Mud Pump 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Mud Pump 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 5 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Gen Set Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Gen Set Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Gen Set Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Gen Set Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 6 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Gen Set 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Gen Set 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Gen Set 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Gen Set 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
       
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 7 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Air Comp Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Air Comp Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Air Comp Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Air Comp Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 8 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Air Comp 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Air Comp 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Air Comp 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Air Comp 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
         If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 9 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Lighting Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Lighting Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Lighting Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Lighting Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 10 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Lighting 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Lighting 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Lighting 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Lighting 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 11 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Work Basket Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Work Basket Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Work Basket Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Work Basket Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 12 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Work Basket Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Work Basket Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Work Basket Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Work Basket Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 13 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Work Basket 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Work Basket 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Work Basket 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Work Basket 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 14 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Gin Pole Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Gin Pole Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Gin Pole Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Gin Pole Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 15 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Gin Pole Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Gin Pole Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Gin Pole Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Gin Pole Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 16 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Gin Pole 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Gin Pole 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Gin Pole 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Gin Pole 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 17 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("CB Winch Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("CB Winch Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("CB Winch Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("CB Winch Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 18 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("CB Winch Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("CB Winch Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("CB Winch Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("CB Winch Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 19 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("CB Winch 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("CB Winch 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("CB Winch 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("CB Winch 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 20 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Power Tong Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Power Tong Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Power Tong Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Power Tong Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 21 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Power Tong Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Power Tong Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Power Tong Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Power Tong Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 22 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Power Tong 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Power Tong 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Power Tong 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Power Tong 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
         If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 23 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Power Tong Yearly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Power Tong Yearly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Power Tong Yearly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Power Tong Yearly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 24 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Manual Tong Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Manual Tong Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Manual Tong Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Manual Tong Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 25 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Manual Tong 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Manual Tong 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Manual Tong 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Manual Tong 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 26 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Rotary Table Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Rotary Table Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Rotary Table Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Rotary Table Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 27 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Rotary Table Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Rotary Table Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Rotary Table Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Rotary Table Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 28 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Rotary Table 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Rotary Table 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Rotary Table 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Rotary Table 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 29 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Load Cell Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Load Cell Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Load Cell Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Load Cell Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 30 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Load Cell 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Load Cell 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Load Cell 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Load Cell 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 31 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Hydraulic Jack Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Hydraulic Jack Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Hydraulic Jack Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Hydraulic Jack Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 32 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Hydraulic Jack Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Hydraulic Jack Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Hydraulic Jack Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Hydraulic Jack Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 33 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Hydraulic Jack 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Hydraulic Jack 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Hydraulic Jack 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Hydraulic Jack 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 34 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Window Frame Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Window Frame Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Window Frame Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Window Frame Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 35 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Window Frame 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Window Frame 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Window Frame 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Window Frame 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 36 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Spider Type C-HD Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Spider Type C-HD Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Spider Type C-HD Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Spider Type C-HD Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 37 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Spider Type C-HD 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Spider Type C-HD 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Spider Type C-HD 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Spider Type C-HD 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 38 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Spider Type F Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Spider Type F Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Spider Type F Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Spider Type F Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 39 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Spider Type F 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Spider Type F 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Spider Type F 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Spider Type F 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 40 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("500K Slip Bowl Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("500K Slip Bowl Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("500K Slip Bowl Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("500K Slip Bowl Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 41 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("500K Slip Bowl 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("500K Slip Bowl 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("500K Slip Bowl 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("500K Slip Bowl 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 42 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Annular BOP Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Annular BOP Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Annular BOP Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Annular BOP Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 43 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Annular BOP Yearly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Annular BOP Yearly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Annular BOP Yearly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Annular BOP Yearly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 44 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Single Ram BOP Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Single Ram BOP Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Single Ram BOP Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Single Ram BOP Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 45 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Single Ram BOP 3 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Single Ram BOP 3 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Single Ram BOP 3 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Single Ram BOP 3 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 46 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Single Ram BOP Yearly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Single Ram BOP Yearly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Single Ram BOP Yearly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Single Ram BOP Yearly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 47 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Double Ram BOP Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Double Ram BOP Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Double Ram BOP Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Double Ram BOP Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 48 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Double Ram BOP 3 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Double Ram BOP 3 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Double Ram BOP 3 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Double Ram BOP 3 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 49 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Double Ram BOP Yearly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Double Ram BOP Yearly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Double Ram BOP Yearly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Double Ram BOP Yearly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 50 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Riser Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Riser Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Riser Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Riser Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 51 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Riser 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Riser 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Riser 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Riser 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 52 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Choke Kill Manifold Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Choke Kill Manifold Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Choke Kill Manifold Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Choke Kill Manifold Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 53 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Choke Kill Manifold Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Choke Kill Manifold Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Choke Kill Manifold Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Choke Kill Manifold Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 54 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Choke Kill Manifold 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Choke Kill Manifold 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Choke Kill Manifold 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Choke Kill Manifold 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 55 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Circulation Manifold Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Circulation Manifold Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Circulation Manifold Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Circulation Manifold Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 56 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Circulation Manifold Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Circulation Manifold Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Circulation Manifold Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Circulation Manifold Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 57 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Circulation Manifold 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Circulation Manifold 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Circulation Manifold 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Circulation Manifold 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 58 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Suction Manifold Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Suction Manifold Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Suction Manifold Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Suction Manifold Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 59 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Suction Manifold 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Suction Manifold 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Suction Manifold 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Suction Manifold 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 60 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Lifting Skid 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Lifting Skid 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Lifting Skid 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Lifting Skid 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 61 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Accumulator Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Accumulator Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Accumulator Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Accumulator Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 62 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Accumulator Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Accumulator Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Accumulator Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Accumulator Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 63 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Accumulator 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Accumulator 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Accumulator 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Accumulator 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
         If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 64 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Accumulator Yearly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Accumulator Yearly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Accumulator Yearly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Accumulator Yearly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 65 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Shale Shaker Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Shale Shaker Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Shale Shaker Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Shale Shaker Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 66 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Shale Shaker 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Shale Shaker 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Shale Shaker 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Shale Shaker 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 67 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("BOP Test Pump Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("BOP Test Pump Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("BOP Test Pump Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("BOP Test Pump Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 68 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("BOP Test Pump Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("BOP Test Pump Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("BOP Test Pump Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("BOP Test Pump Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 69 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("BOP Test Pump 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("BOP Test Pump 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("BOP Test Pump 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("BOP Test Pump 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 70 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Skid Frame Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Skid Frame Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Skid Frame Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Skid Frame Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 71 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Skid Frame 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Skid Frame 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Skid Frame 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Skid Frame 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 72 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Stair Assembly Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Stair Assembly Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Stair Assembly Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Stair Assembly Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 73 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Stair Assembly 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Stair Assembly 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Stair Assembly 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Stair Assembly 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 74 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Master Skid Assembly Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Master Skid Assembly Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Master Skid Assembly Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Master Skid Assembly Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 75 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Master Skid Assembly 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Master Skid Assembly 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Master Skid Assembly 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Master Skid Assembly 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 76 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Container Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Container Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Container Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Container Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 77 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Container 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Container 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Container 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Container 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 78 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Toolbox Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Toolbox Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Toolbox Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Toolbox Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 79 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Toolbox 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Toolbox 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Toolbox 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Toolbox 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 80 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Basket Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Basket Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Basket Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Basket Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 81 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Basket 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Basket 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Basket 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Basket 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 82 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Pipe Rack Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Pipe Rack Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Pipe Rack Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Pipe Rack Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 83 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Pipe Rack 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Pipe Rack 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Pipe Rack 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Pipe Rack 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 84 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Rack Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Rack Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Rack Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Rack Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 85 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Rack 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Rack 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Rack 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Rack 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 86 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Trip Tank Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Trip Tank Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Trip Tank Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Trip Tank Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 87 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Trip Tank 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Trip Tank 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Trip Tank 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Trip Tank 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 88 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Mixing Tank Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Mixing Tank Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Mixing Tank Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Mixing Tank Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 89 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Mixing Tank 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Mixing Tank 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Mixing Tank 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Mixing Tank 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 90 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Circulation Tank Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Circulation Tank Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Circulation Tank Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Circulation Tank Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 91 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Circulation Tank 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Circulation Tank 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Circulation Tank 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Circulation Tank 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 92 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Mud Tank Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Mud Tank Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Mud Tank Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Mud Tank Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 93 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Mud Tank 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Mud Tank 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Mud Tank 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Mud Tank 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 94 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Diesel Tank Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Diesel Tank Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Diesel Tank Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Diesel Tank Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 95 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Diesel Tank 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Diesel Tank 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Diesel Tank 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Diesel Tank 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 96 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("MCM Pump Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("MCM Pump Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("MCM Pump Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("MCM Pump Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 97 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("MCM Pump 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("MCM Pump 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("MCM Pump 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("MCM Pump 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 98 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Mud Gas Seperator 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Mud Gas Seperator 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Mud Gas Seperator 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Mud Gas Seperator 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 99 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Comm. + Electronic Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Comm. + Electronic Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Comm. + Electronic Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Comm. + Electronic Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 100 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Lifting Gear 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Lifting Gear 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Lifting Gear 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Lifting Gear 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 101 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("High Press Pump Line Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("High Press Pump Line Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("High Press Pump Line Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("High Press Pump Line Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 102 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("High Press Pump Line 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("High Press Pump Line 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("High Press Pump Line 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("High Press Pump Line 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 103 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Tubulars 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Tubulars 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Tubulars 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Tubulars 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 104 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Suction Line 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Suction Line 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Suction Line 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Suction Line 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 105 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Rig Accessories 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Rig Accessories 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Rig Accessories 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Rig Accessories 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 106 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("BHA + Safety Valve Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("BHA + Safety Valve Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("BHA + Safety Valve Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("BHA + Safety Valve Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 107 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("BHA + Safety Valve 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("BHA + Safety Valve 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("BHA + Safety Valve 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("BHA + Safety Valve 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 108 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Lockdown System Weekly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Lockdown System Weekly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Lockdown System Weekly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Lockdown System Weekly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        'Copy Open WO to Open WO Sheet
         If WorksheetFunction.CountIf(OpenWORng, Worksheets("RIG PMS").Cells(a, Acolumn).Value) = 0 And AA = 1 Then
            Worksheets("Open WO").Range("B" & Worksheets("Open WO").Range("B" & Rows.Count).End(xlUp).Row + 1).Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO No.
            Worksheets("Open WO").Range("C" & Worksheets("Open WO").Range("C" & Rows.Count).End(xlUp).Row + 1).Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Open WO").Range("D" & Worksheets("Open WO").Range("D" & Rows.Count).End(xlUp).Row + 1).Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Asset Description
            Worksheets("Open WO").Range("E" & Worksheets("Open WO").Range("D" & Rows.Count).End(xlUp).Row).Value = 1 'For trigger purpose
        End If
    Next a
   
End Sub
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I have simple but long code as below. I am getting error saying that "Procedure too large". Can someone tell me how to make it shorter or split it? Appreciate and thanks in advance.

Code:
    For a = 7 To LRow Step 3
        AA = 0
        
        [COLOR="#FF0000"]If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value[/COLOR] [COLOR="#0000CD"][B]= 1[/B][/COLOR] Then
           [COLOR="#FF0000"] b = Worksheets("RIG PMS").Cells(a, 7).Value[/COLOR]
            [COLOR="#FF0000"]Worksheets("[/COLOR][COLOR="#0000CD"][B]Power Pack Monthly[/B][/COLOR][COLOR="#FF0000"]").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code[/COLOR]
            [COLOR="#FF0000"]Worksheets("[/COLOR][COLOR="#0000CD"][B]Power Pack Monthly[/B][/COLOR][COLOR="#FF0000"]").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description[/COLOR]
            [COLOR="#FF0000"]Worksheets("[/COLOR][COLOR="#0000CD"][B]Power Pack Monthly[/B][/COLOR][COLOR="#FF0000"]").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO[/COLOR]
            [COLOR="#FF0000"]Worksheets("[/COLOR][B][COLOR="#0000CD"][B]Power Pack Monthly[/B][/COLOR][/B][COLOR="#FF0000"]").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Dat[/COLOR]e
            [COLOR="#FF0000"]AA = 1[/COLOR]
        [COLOR="#FF0000"]End If[/COLOR]
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 2 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Power Pack 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Power Pack 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Power Pack 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Power Pack 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 3 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Mud Pump Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Mud Pump Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Mud Pump Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Mud Pump Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
        
        If Worksheets("RIG PMS").Cells(a, Acolumn).Value <> "" And Worksheets("RIG PMS").Cells(a, Acolumn - 2).Value = 4 Then
            b = Worksheets("RIG PMS").Cells(a, 7).Value
            Worksheets("Mud Pump 6 Monthly").Range("C5").Value = Worksheets("RIG PMS").Cells(a - b, 2).Value 'Asset Code
            Worksheets("Mud Pump 6 Monthly").Range("C6").Value = Worksheets("RIG PMS").Cells(a - b, 3).Value 'Description
            Worksheets("Mud Pump 6 Monthly").Range("P5").Value = Worksheets("RIG PMS").Cells(a, Acolumn).Value 'WO
            Worksheets("Mud Pump 6 Monthly").Range("P6").Value = Worksheets("RIG PMS").Cells(a + 1, Acolumn).Value 'Proposed Date
            AA = 1
        End If
Firstly, I haven't gone right through your code (& I'm not going to :)), but one thing to always look for is repetition & similarity in sections of code.
What I post below will most likely not work immediately for you but this sort of thing is what you can do.

From a quick look all those sections of code I have shown above (and more) are all the same except for the blue text. So it is only the blue parts we really need to work on.

Here's a structure that should do a similar job, with many less lines.
Notice too how I've changed the code so I've only had to write the text Worksheets("RIG PMS") once.

Rich (BB code):
Dim ws As String

With Worksheets("RIG PMS")
  b = .Cells(a, 7).Value
  AA = 1
  If .Cells(a, Acolumn).Value <> "" Then
    Select Case .Cells(a, Acolumn - 2).Value
      Case 1
        ws = "Power Pack Monthly"
      Case 2
        ws = "Power Pack 6 Monthly"
      Case 3
        ws = "Mud Pump Monthly"
      
                                    '<- Add more Case statements here
      
      Case Else
        ws = ""
    End Select
  End If
  If ws <> "" Then
    Worksheets(ws).Range("C5").Value = .Cells(a - b, 2).Value 'Asset Code
    Worksheets(ws).Range("C6").Value = .Cells(a - b, 3).Value 'Description
    Worksheets(ws).Range("P5").Value = .Cells(a, Acolumn).Value 'WO
    Worksheets(ws).Range("P6").Value = .Cells(a + 1, Acolumn).Value 'Proposed Date
  End If

End With
 
Upvote 0
I'd do something quite similar to Peter:
Code:
Dim wsTgt As Worksheet
With Worksheets("RIG PMS")
    LRow = .Cells(Rows.Count, "I").End(xlUp).Row
    For a = 7 To LRow Step 3
        AA = 0
        If .Cells(a, Acolumn).Value <> "" Then
          b = .Cells(a, 7).Value
          Select Case .Cells(a, Acolumn - 2).Value
            Case 1: Set wsTgt = Worksheets("Power Pack Monthly")
            Case 2: Set wsTgt = Worksheets("Power Pack 6 Monthly")
            Case 3: Set wsTgt = Worksheets("Mud Pump Monthly")
            Case 4: Set wsTgt = Worksheets("Mud Pump 6 Monthly")
            Case 5: Set wsTgt = Worksheets("Gen Set Monthly")
            'Continue down to Case 108
          End Select
          wsTgt.Range("C5").Value = .Cells(a - b, 2).Value 'Asset Code
          wsTgt.Range("C6").Value = .Cells(a - b, 3).Value 'Description
          wsTgt.Range("P5").Value = .Cells(a, Acolumn).Value 'WO
          wsTgt.Range("P6").Value = .Cells(a + 1, Acolumn).Value 'Proposed Date
          AA = 1
        End If
        
        'Copy Open WO to Open WO Sheet
         If WorksheetFunction.CountIf(OpenWORng, .Cells(a, Acolumn).Value) = 0 And AA = 1 Then
            Worksheets("Open WO").Range("B" & Worksheets("Open WO").Range("B" & Rows.Count).End(xlUp).Row + 1).Value = .Cells(a, Acolumn).Value 'WO No.
            Worksheets("Open WO").Range("C" & Worksheets("Open WO").Range("C" & Rows.Count).End(xlUp).Row + 1).Value = .Cells(a - b, 2).Value 'Asset Code
            Worksheets("Open WO").Range("D" & Worksheets("Open WO").Range("D" & Rows.Count).End(xlUp).Row + 1).Value = .Cells(a - b, 3).Value 'Asset Description
            Worksheets("Open WO").Range("E" & Worksheets("Open WO").Range("D" & Rows.Count).End(xlUp).Row).Value = 1 'For trigger purpose
        End If
    Next a
End With
As in Peter's code, I'd reference Worksheets("RIG PMS") only once. The key difference is that, whereas Peter retrieved just the worksheet name via Select Case, I'd set a reference to it there. You could also hybridize the two:
Code:
Dim strWsNm As String, wsTgt As Worksheet
With Worksheets("RIG PMS")
    LRow = .Cells(Rows.Count, "I").End(xlUp).Row
    For a = 7 To LRow Step 3
        AA = 0
        If .Cells(a, Acolumn).Value <> "" Then
          b = .Cells(a, 7).Value
          Select Case .Cells(a, Acolumn - 2).Value
            Case 1: strWsNm = "Power Pack Monthly"
            Case 2: strWsNm = "Power Pack 6 Monthly"
            Case 3: strWsNm = "Mud Pump Monthly"
            Case 4: strWsNm = "Mud Pump 6 Monthly"
            Case 5: strWsNm = "Gen Set Monthly"
            'Continue down to Case 108
          End Select
          Set wsTgt = Worksheets(strWsNm)
          wsTgt.Range("C5").Value = .Cells(a - b, 2).Value 'Asset Code
          wsTgt.Range("C6").Value = .Cells(a - b, 3).Value 'Description
          wsTgt.Range("P5").Value = .Cells(a, Acolumn).Value 'WO
          wsTgt.Range("P6").Value = .Cells(a + 1, Acolumn).Value 'Proposed Date
          AA = 1
        End If
        
        'Copy Open WO to Open WO Sheet
         If WorksheetFunction.CountIf(OpenWORng, .Cells(a, Acolumn).Value) = 0 And AA = 1 Then
            Worksheets("Open WO").Range("B" & Worksheets("Open WO").Range("B" & Rows.Count).End(xlUp).Row + 1).Value = .Cells(a, Acolumn).Value 'WO No.
            Worksheets("Open WO").Range("C" & Worksheets("Open WO").Range("C" & Rows.Count).End(xlUp).Row + 1).Value = .Cells(a - b, 2).Value 'Asset Code
            Worksheets("Open WO").Range("D" & Worksheets("Open WO").Range("D" & Rows.Count).End(xlUp).Row + 1).Value = .Cells(a - b, 3).Value 'Asset Description
            Worksheets("Open WO").Range("E" & Worksheets("Open WO").Range("D" & Rows.Count).End(xlUp).Row).Value = 1 'For trigger purpose
        End If
    Next a
End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top