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
| sub()
Dim PM As Range
Dim tableAtténuation As ListObject
Dim TablePente As ListObject
Dim TableReflectance As ListObject
Dim TableContrainte As ListObject
Dim rg As Range
Dim rg1 As Range
Dim rg2 As Range
Dim rg3 As Range
'Cree le tableauAtténuation en C12
Worksheets("Hors Normes").Activate
Set rg = Cells(12, 3).CurrentRegion
'Boucle pour définir le début des tableaux Pente, reflectance et Contrainte
For i = 13 To 1000
If Cells(i, 3) = "N° Pente" Then
Rows(i + 1).Delete
Set rg1 = Cells(i + 1, 3).CurrentRegion
End If
If Cells(i, 3) = "Réflectance" Then
Rows(i + 1).Delete
Set rg2 = Cells(i, 3).CurrentRegion
End If
If Cells(i, 3) = "N° Epissure" Then
Rows(i + 1).Delete
Set rg3 = Cells(i, 3).CurrentRegion
End If
If Cells(i, 3) = "N° Fibre" Then
Rows(i + 1).Delete
Set rg4 = Cells(i, 3).CurrentRegion
End If
Next
'Création des Tableaux
Set TableContrainte = ActiveSheet.ListObjects.Add(SourceType:=xlSrcRange, Source:=rg3, XlListObjectHasHeaders:=xlYes)
Set TableReflectance = ActiveSheet.ListObjects.Add(SourceType:=xlSrcRange, Source:=rg2, XlListObjectHasHeaders:=xlYes)
Set TablePente = ActiveSheet.ListObjects.Add(SourceType:=xlSrcRange, Source:=rg1, XlListObjectHasHeaders:=xlYes)
Set tableAtténuation = ActiveSheet.ListObjects.Add(SourceType:=xlSrcRange, Source:=rg, XlListObjectHasHeaders:=xlYes)
end sub |
Partager