You are on page 1of 2

Sub Legend_tab_summ2() 'R. Ribeiro - renato.ribeiro@2hoffshoreinc.com '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++ 'Deletes Old Data and formating Range("D272:EK297").

ClearContents 'AJ7:BK58,BO7:CP58,CT7:DU58,DY7:EZ58 Dim wksheet, exists, HCons, Comb As String Dim HSE, Env, NFin, Fin As String Dim Nsec, Prob, Nthr As Integer Application.ScreenUpdating = False Application.Calculation = xlCalculateManual 'Maximum Number of Sections(Rows i.e. A to Z) Nsec = Sheets("Section Definition").Range("Nsections").Value 'Maximum Number of Threats (Columns i.e. Columns i.e Corrosion, Fatigue etc.) Nthr = Sheets("Threat List").Range("Nthreats").Value For j = 1 To Nsec 'Populate the Criticalty HSE, Environment, Non-Financial, Financial Tables For i = 1 To Nthr 'Populate the Criticalty Summary Tables Comb = ActiveSheet.Cells(6 + j, 4 + 2 * i - 1).Value equip = ActiveSheet.Cells(6 + j, 4).Value If Comb = "n/a" Then ActiveSheet.Cells(271 + j, 4 + 1 * i - 1).Value = " " ElseIf Comb = "0" Then ActiveSheet.Cells(271 + j, 4 + 1 * i - 1).Value = " " Else ActiveSheet.Cells(271 + j, 4 + 1 * i - 1).Value = (Comb & " - " & equip) End If 'Populate the HSE Criticalty Tables Comb = ActiveSheet.Cells(6 + j, 35 + 2 * i - 1).Value If Comb = "n/a" Then ActiveSheet.Cells(271 + j, 35 + 1 * i - 1).Value = "" ElseIf Comb = "0" Then ActiveSheet.Cells(271 + j, 35 + 1 * i - 1).Value = "" Else ActiveSheet.Cells(271 + j, 35 + 1 * i - 1).Value = (Comb & " - " & equip) End If 'Populate the Non-Financial Criticalty Tables Comb = ActiveSheet.Cells(6 + j, 66 + 2 * i - 1).Value If Comb = "n/a" Then ActiveSheet.Cells(271 + j, 66 + 1 * i - 1).Value = "" ElseIf Comb = "0" Then ActiveSheet.Cells(271 + j, 66 + 1 * i - 1).Value = "" Else ActiveSheet.Cells(271 + j, 66 + 1 * i - 1).Value = (Comb & " - " & equip) End If 'Populate the FinancialCriticalty Tables Comb = ActiveSheet.Cells(6 + j, 97 + 2 * i - 1).Value

If Comb = "n/a" Then ActiveSheet.Cells(271 + j, 97 + 1 * i - 1).Value = " " ElseIf Comb = "0" Then ActiveSheet.Cells(271 + j, 97 + 1 * i - 1).Value = " " Else ActiveSheet.Cells(271 + j, 97 + 1 * i - 1).Value = (Comb & " - " & equip) End If 'Populate the Environment Criticalty Tables Comb = ActiveSheet.Cells(6 + j, 128 + 2 * i - 1).Value If Comb = "n/a" Then ActiveSheet.Cells(271 + j, 128 + 1 * i - 1).Value = "" ElseIf Comb = "0" Then ActiveSheet.Cells(271 + j, 128 + 1 * i - 1).Value = "" Else ActiveSheet.Cells(271 + j, 128 + 1 * i - 1).Value = (Comb & " - " & equip) End If Next i Next j Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic End Sub

You might also like