1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
|
Option Explicit
Dim sIRNT As String 'IRN Techno colonne B onglet techno
Dim sTec As String 'Nom techno
Dim sIRNM As String 'IRN Appli métier colonne B onglet Metier
Dim sIRNA As String 'IRN Appli finale colonne A Applis
Dim sDom As String ' Domaine en clair de l'application finale
Dim sSDom As String ' Code domaine de l'application finale
Dim sComp As String ' Code sous domaine de l'application finale
Dim sType As String ' Sous type de l'application finale
Dim sEtat As String ' Etat de l'application finale
Dim sSIA As String 'SIA application finale
Dim sDesc As String 'Descriptif appli finale
Dim sRelT As String 'Relation entre Techno et appli métier
Dim sRel As String 'Relation entre appli métier et appli finale
Dim sCrit As String 'Criticité appli finale
Dim sDebM As String 'Adresse résultat recherche dans Metier
Dim sDebL As String 'Adresse résultat recherche dans Liens
Dim iDerLT As Integer 'Dernière ligne Techno
Dim lDerLA As Long 'Dernière ligne Applis
Dim lDerLL As Long 'Dernière ligne Liens
Dim lDerLM As Long 'Dernière ligne Metier
Dim iPF As Integer 'Point fonction appli finale
Dim n As Integer 'Compteur
Dim c As Object 'Recherche
Dim d As Object 'Recherche
Dim e As Object 'Recherche
Sub rtb()
Application.ScreenUpdating = False
Worksheets("RTB").Select
Range("A2").Select
Range("A2:Z20000").ClearContents
Worksheets("Metier").Select
lDerLM = Range("A1").End(xlDown).Row
Worksheets("Liens").Select
lDerLL = Range("C2").End(xlDown).Row
Worksheets("Applis").Select
lDerLA = Range("A1").End(xlDown).Row
Worksheets("Techno").Select
iDerLT = Range("A1").End(xlDown).Row
n = 1
For n = 2 To iDerLT
sIRNT = Cells(n, 2).Value
sTec = Cells(n, 1).Value
Worksheets("Metier").Select
With Worksheets("Metier").Range(Cells(1, 4), Cells(lDerLM, 4))
Set c = .Find(sIRNT)
If Not c Is Nothing Then
sDebM = c.Address
Do
sIRNM = Cells(c.Row, 2).Value
If sIRNM = sIRNT Then GoTo suiteM
Worksheets("Liens").Select
With Worksheets("Liens").Range(Cells(1, 1), Cells(lDerLL, 1))
Set d = .Find(sIRNM)
If Not d Is Nothing Then
sDebL = d.Address
Do
sIRNA = Cells(d.Row, 3).Value
sRel = Cells(d.Row, 5).Value
Worksheets("Applis").Select
With Worksheets("Applis").Range(Cells(1, 1), Cells(lDerLA, 1))
Set e = .Find(sIRNA)
If Not e Is Nothing Then
sSDom = Left(Cells(e.Row, 5).Value, 3)
If Left(sSDom, 1) = "C" Then
sDom = "Commerce"
ElseIf Left(sSDom, 1) = "F" Then
sDom = "FSC"
ElseIf Left(sSDom, 1) = "G" Then
sDom = "GRM"
ElseIf Left(sSDom, 1) = "I" Then
sDom = "IQ"
ElseIf Left(sSDom, 1) = "T" Then
sDom = "TEC"
Else
sDom = sDom & ": Domaine non traité"
End If
sComp = Left(Cells(e.Row, 6).Value, 6)
sEtat = Cells(e.Row, 9).Value
sSIA = Cells(e.Row, 20).Value
sDesc = Cells(e.Row, 2).Value
sType = Cells(e.Row, 7).Value
sCrit = Cells(e.Row, 14).Value
If sCrit = "1" Then
sCrit = "1-Stratégique"
ElseIf sCrit = "2" Then
sCrit = "2-Critique"
ElseIf sCrit = "3" Then
sCrit = "3-Standard"
ElseIf sCrit = "4" Then
sCrit = "4-Minimum"
End If
iPF = Cells(e.Row, 15).Value
Else
sDom = "Non trouvé liste applis"
sSDom = ""
sEtat = ""
sSIA = ""
sDesc = ""
sType = ""
sCrit = ""
End If
End With
Worksheets("RTB").Select
ActiveCell.Value = sIRNT
ActiveCell.Offset(0, 1).Value = sTec
ActiveCell.Offset(0, 2).Value = sDom
ActiveCell.Offset(0, 3).Value = sSDom
ActiveCell.Offset(0, 4).Value = sComp
ActiveCell.Offset(0, 5).Value = sEtat
ActiveCell.Offset(0, 6).Value = sIRNA
ActiveCell.Offset(0, 7).Value = sSIA
ActiveCell.Offset(0, 8).Value = sDesc
ActiveCell.Offset(0, 9).Value = sType
ActiveCell.Offset(0, 10).Value = sCrit
ActiveCell.Offset(0, 11).Value = iPF
ActiveCell.Offset(0, 14).Value = sRel
ActiveCell.Offset(1, 0).Select
Worksheets("Liens").Select
Set d = .FindNext(d)
Loop Until Not d Is Nothing And d.Address <> sDebL
Else
sDom = "Pas de relation trouvée pour " & sIRNM
sSDom = ""
sEtat = ""
sSIA = ""
sDesc = ""
sType = ""
sCrit = ""
Worksheets("RTB").Select
ActiveCell.Value = sIRNT
ActiveCell.Offset(0, 1).Value = sTec
ActiveCell.Offset(0, 2).Value = sDom
End If
End With
suiteM:
Worksheets("Techno").Select
Set c = .FindNext(c)
Loop Until Not c Is Nothing And c.Address <> sDebM
Else
sDom = "Pas d'applis trouvé pour cette techno"
sSDom = ""
sEtat = ""
sSIA = ""
sDesc = ""
sType = ""
sCrit = ""
Worksheets("RTB").Select
ActiveCell.Value = sIRNT
ActiveCell.Offset(0, 1).Value = sTec
ActiveCell.Offset(0, 2).Value = sDom
End If
End With
Next
End Sub |
Partager