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
| Private Sub G_Environ()
Dim FEnviron As Worksheet
' Suppression de l'onglet s'il existe deja
For Each FEnviron In Worksheets
If FEnviron.Name = "Environ" Then
FEnviron.Delete
End If
Next
Set FEnviron = Worksheets.Add(Before:=Worksheets(Worksheets.Count))
FEnviron.Name = "Environ"
For i = 1 To 255
On Error Resume Next
Debug.Print i & " : "; Environ(i)
If Environ(i) > " " Then
FEnviron.Cells(i + 1, 1).Value = i
FEnviron.Cells(i + 1, 2).Value = Environ(i)
End If
On Error GoTo 0
Next
' Separation au niveau de la variabel d'environnement
Columns("B:B").TextToColumns Destination:=Range("B2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="=", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
' Formatage des cellules
FEnviron.Cells(1, 1).Value = "Numéro"
FEnviron.Cells(1, 2).Value = "Nom"
FEnviron.Cells(1, 3).Value = "Chemin"
With FEnviron.Range("A1").CurrentRegion
.Columns.AutoFit
' .HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.BorderAround Weight:=xlThick
.Borders.LineStyle = xlContinuous
End With
With Union(FEnviron.Cells(1, 1), FEnviron.Cells(1, 2), FEnviron.Cells(1, 3))
.Font.bold = True
With .Interior
.ThemeColor = xlThemeColorAccent3
.TintAndShade = -0.249977111117893
End With
End With
End Sub |
Partager