Bonjour Outils, Options, onglet Affichage et cocher "Formules"
Cordialement Pascal
"laux01" a écrit dans le message de news:2229f01c45ce9$3abac2f0$
Bonjour,
Comment peut on afficher les formules d'une feuille excel ?
Merci de vos reponses
ChrisV
Bonjour laux01,
Ou encore, Ctrl+# ou, créer une feuille récap...
Sub ListeFormules() 'd'après une idée de Torsten Harden 'modif ChrisV Dim Zn As Range, c As Range, _ reS As Worksheet, i As Integer, reP On Error Resume Next Set Zn = Range("A1").SpecialCells(xlFormulas) If Zn Is Nothing Then reP = MsgBox("La feuille de calcul active " & _ "ne contient aucune formule.", vbExclamation) Exit Sub End If Application.ScreenUpdating = False Set reS = ActiveWorkbook.Worksheets.Add(, ActiveSheet) reS.Name = "Formules dans " & Zn.Parent.Name With reS .Range("A1") = "Cellule" .Range("B1") = "Formule" .Range("C1") = "Valeur" .Range("D1") = "Format" .Range("E1") = "Affichage" .Range("A1:E1").Font.Bold = True .Columns("D:D").NumberFormat = "@" End With i = 2 For Each c In Zn Application.StatusBar = Format((i - 1) / Zn.Count, _ "0%") reS.Cells(i, 1) = c.Address(0, 0) If c.HasArray = True Then reS.Cells(i, 2) = " {" & c.FormulaLocal & "}" Else reS.Cells(i, 2) = " " & c.FormulaLocal End If With reS .Cells(i, 3) = c.Value .Cells(i, 4) = c.NumberFormatLocal .Cells(i, 5) = c.Value .Cells(i, 5).NumberFormat = c.NumberFormat i = i + 1 End With Next c reS.Columns("A:E").AutoFit Range("A1:E1").Interior.ColorIndex = 6 Selection.CurrentRegion.Borders.LineStyle = xlContinuous ActiveWindow.DisplayGridlines = False Application.StatusBar = False End Sub
ChrisV
"laux01" a écrit dans le message de news:2229f01c45ce9$3abac2f0$
Bonjour,
Comment peut on afficher les formules d'une feuille excel ?
Merci de vos reponses
Bonjour laux01,
Ou encore, Ctrl+#
ou, créer une feuille récap...
Sub ListeFormules()
'd'après une idée de Torsten Harden
'modif ChrisV
Dim Zn As Range, c As Range, _
reS As Worksheet, i As Integer, reP
On Error Resume Next
Set Zn = Range("A1").SpecialCells(xlFormulas)
If Zn Is Nothing Then
reP = MsgBox("La feuille de calcul active " & _
"ne contient aucune formule.", vbExclamation)
Exit Sub
End If
Application.ScreenUpdating = False
Set reS = ActiveWorkbook.Worksheets.Add(, ActiveSheet)
reS.Name = "Formules dans " & Zn.Parent.Name
With reS
.Range("A1") = "Cellule"
.Range("B1") = "Formule"
.Range("C1") = "Valeur"
.Range("D1") = "Format"
.Range("E1") = "Affichage"
.Range("A1:E1").Font.Bold = True
.Columns("D:D").NumberFormat = "@"
End With
i = 2
For Each c In Zn
Application.StatusBar = Format((i - 1) / Zn.Count, _
"0%")
reS.Cells(i, 1) = c.Address(0, 0)
If c.HasArray = True Then
reS.Cells(i, 2) = " {" & c.FormulaLocal & "}"
Else
reS.Cells(i, 2) = " " & c.FormulaLocal
End If
With reS
.Cells(i, 3) = c.Value
.Cells(i, 4) = c.NumberFormatLocal
.Cells(i, 5) = c.Value
.Cells(i, 5).NumberFormat = c.NumberFormat
i = i + 1
End With
Next c
reS.Columns("A:E").AutoFit
Range("A1:E1").Interior.ColorIndex = 6
Selection.CurrentRegion.Borders.LineStyle = xlContinuous
ActiveWindow.DisplayGridlines = False
Application.StatusBar = False
End Sub
ChrisV
"laux01" <anonymous@discussions.microsoft.com> a écrit dans le message de
news:2229f01c45ce9$3abac2f0$a101280a@phx.gbl...
Bonjour,
Comment peut on afficher les formules d'une feuille excel ?
Sub ListeFormules() 'd'après une idée de Torsten Harden 'modif ChrisV Dim Zn As Range, c As Range, _ reS As Worksheet, i As Integer, reP On Error Resume Next Set Zn = Range("A1").SpecialCells(xlFormulas) If Zn Is Nothing Then reP = MsgBox("La feuille de calcul active " & _ "ne contient aucune formule.", vbExclamation) Exit Sub End If Application.ScreenUpdating = False Set reS = ActiveWorkbook.Worksheets.Add(, ActiveSheet) reS.Name = "Formules dans " & Zn.Parent.Name With reS .Range("A1") = "Cellule" .Range("B1") = "Formule" .Range("C1") = "Valeur" .Range("D1") = "Format" .Range("E1") = "Affichage" .Range("A1:E1").Font.Bold = True .Columns("D:D").NumberFormat = "@" End With i = 2 For Each c In Zn Application.StatusBar = Format((i - 1) / Zn.Count, _ "0%") reS.Cells(i, 1) = c.Address(0, 0) If c.HasArray = True Then reS.Cells(i, 2) = " {" & c.FormulaLocal & "}" Else reS.Cells(i, 2) = " " & c.FormulaLocal End If With reS .Cells(i, 3) = c.Value .Cells(i, 4) = c.NumberFormatLocal .Cells(i, 5) = c.Value .Cells(i, 5).NumberFormat = c.NumberFormat i = i + 1 End With Next c reS.Columns("A:E").AutoFit Range("A1:E1").Interior.ColorIndex = 6 Selection.CurrentRegion.Borders.LineStyle = xlContinuous ActiveWindow.DisplayGridlines = False Application.StatusBar = False End Sub
ChrisV
"laux01" a écrit dans le message de news:2229f01c45ce9$3abac2f0$
Bonjour,
Comment peut on afficher les formules d'une feuille excel ?