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
| Option Explicit
Option Base 1
Sub Test()
MasqueContenuCell_Print Worksheets(1), Range("C4:F15")
End Sub
Sub MasqueContenuCell_Print(Feuille As Worksheet, Plage As Range)
Dim FormatInit() As Variant
Dim Cell As Range
Dim i As Integer
ReDim Preserve FormatInit(Plage.Cells.Count)
For Each Cell In Plage
i = i + 1
FormatInit(i) = Cell.NumberFormat
Next Cell
Plage.NumberFormat = ";;;"
Feuille.PrintPreview
'Feuille.Print
i = 0
For Each Cell In Plage
i = i + 1
Cell.NumberFormat = FormatInit(i)
Next Cell
End Sub |
Partager