Il y a quelques mois sur le forum il y a eu discussions sur la façon de
réduire le poids d'un fichier EXCEL dans le quel plusieurs manipulations
avaient laisser des traces.
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
MichD
Bonjour,
Copie cette macro dans un module standard et exécute-la une fois Est-ce que cela a un effet positif sur le poids de ton fichier?
'------------------------------------------------------------------ Sub test() Dim Sh As Worksheet, DerLig As Long, DerCol As Integer Dim ModeCalcul As String
Application.ScreenUpdating = False ModeCalcul = Application.Calculation Application.Calculation = xlCalculationManual Application.EnableEvents = False On Error Resume Next For Each Sh In ThisWorkbook.Worksheets With Sh If Not IsEmpty(.UsedRange) Then DerLig = .Cells.Find(What:="*", _ LookIn:=xlFormulas, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
DerCol = .Cells.Find(What:="*", _ LookIn:=xlFormulas, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious).Column .Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count, .Columns.Count)).Clear .Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count, .Columns.Count)).Delete .Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count, .Columns.Count)).Clear .Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count, .Columns.Count)).Delete End If End With If Err <> 0 Then Err = 0 Next Application.Calculation = ModeCalcul Application.EnableEvents = True Application.ScreenUpdating = True End Sub '------------------------------------------------------------------
Bonjour,
Copie cette macro dans un module standard et exécute-la une fois
Est-ce que cela a un effet positif sur le poids de ton fichier?
'------------------------------------------------------------------
Sub test()
Dim Sh As Worksheet, DerLig As Long, DerCol As Integer
Dim ModeCalcul As String
Application.ScreenUpdating = False
ModeCalcul = Application.Calculation
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
On Error Resume Next
For Each Sh In ThisWorkbook.Worksheets
With Sh
If Not IsEmpty(.UsedRange) Then
DerLig = .Cells.Find(What:="*", _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
DerCol = .Cells.Find(What:="*", _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
.Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count, .Columns.Count)).Clear
.Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count, .Columns.Count)).Delete
.Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count, .Columns.Count)).Clear
.Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count, .Columns.Count)).Delete
End If
End With
If Err <> 0 Then Err = 0
Next
Application.Calculation = ModeCalcul
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
'------------------------------------------------------------------
Copie cette macro dans un module standard et exécute-la une fois Est-ce que cela a un effet positif sur le poids de ton fichier?
'------------------------------------------------------------------ Sub test() Dim Sh As Worksheet, DerLig As Long, DerCol As Integer Dim ModeCalcul As String
Application.ScreenUpdating = False ModeCalcul = Application.Calculation Application.Calculation = xlCalculationManual Application.EnableEvents = False On Error Resume Next For Each Sh In ThisWorkbook.Worksheets With Sh If Not IsEmpty(.UsedRange) Then DerLig = .Cells.Find(What:="*", _ LookIn:=xlFormulas, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
DerCol = .Cells.Find(What:="*", _ LookIn:=xlFormulas, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious).Column .Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count, .Columns.Count)).Clear .Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count, .Columns.Count)).Delete .Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count, .Columns.Count)).Clear .Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count, .Columns.Count)).Delete End If End With If Err <> 0 Then Err = 0 Next Application.Calculation = ModeCalcul Application.EnableEvents = True Application.ScreenUpdating = True End Sub '------------------------------------------------------------------
albert
Bonjour MichD
Le fichier est passé de 2564 Ko à 304 Ko. Problème de coloration de colonnes de la ligne 2 à la ligne 1 048 576 que la personne a essayé de supprimer de diverses façons.
Un grand merciJe garde précieusement
Albert
"MichD" a écrit dans le message de news:mri7dg$7f7$
Bonjour,
Copie cette macro dans un module standard et exécute-la une fois Est-ce que cela a un effet positif sur le poids de ton fichier?
'------------------------------------------------------------------ Sub test() Dim Sh As Worksheet, DerLig As Long, DerCol As Integer Dim ModeCalcul As String
Application.ScreenUpdating = False ModeCalcul = Application.Calculation Application.Calculation = xlCalculationManual Application.EnableEvents = False On Error Resume Next For Each Sh In ThisWorkbook.Worksheets With Sh If Not IsEmpty(.UsedRange) Then DerLig = .Cells.Find(What:="*", _ LookIn:=xlFormulas, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
DerCol = .Cells.Find(What:="*", _ LookIn:=xlFormulas, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious).Column .Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count, .Columns.Count)).Clear .Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count, .Columns.Count)).Delete .Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count, .Columns.Count)).Clear .Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count, .Columns.Count)).Delete End If End With If Err <> 0 Then Err = 0 Next Application.Calculation = ModeCalcul Application.EnableEvents = True Application.ScreenUpdating = True End Sub '------------------------------------------------------------------
Bonjour MichD
Le fichier est passé de 2564 Ko à 304 Ko.
Problème de coloration de colonnes de la ligne 2 à la ligne 1 048 576 que la
personne a essayé de supprimer de diverses façons.
Un grand merciJe garde précieusement
Albert
"MichD" <michdenis@hotmail.com> a écrit dans le message de
news:mri7dg$7f7$1@speranza.aioe.org...
Bonjour,
Copie cette macro dans un module standard et exécute-la une fois
Est-ce que cela a un effet positif sur le poids de ton fichier?
'------------------------------------------------------------------
Sub test()
Dim Sh As Worksheet, DerLig As Long, DerCol As Integer
Dim ModeCalcul As String
Application.ScreenUpdating = False
ModeCalcul = Application.Calculation
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
On Error Resume Next
For Each Sh In ThisWorkbook.Worksheets
With Sh
If Not IsEmpty(.UsedRange) Then
DerLig = .Cells.Find(What:="*", _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
DerCol = .Cells.Find(What:="*", _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
.Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count,
.Columns.Count)).Clear
.Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count,
.Columns.Count)).Delete
.Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count,
.Columns.Count)).Clear
.Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count,
.Columns.Count)).Delete
End If
End With
If Err <> 0 Then Err = 0
Next
Application.Calculation = ModeCalcul
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
'------------------------------------------------------------------
Le fichier est passé de 2564 Ko à 304 Ko. Problème de coloration de colonnes de la ligne 2 à la ligne 1 048 576 que la personne a essayé de supprimer de diverses façons.
Un grand merciJe garde précieusement
Albert
"MichD" a écrit dans le message de news:mri7dg$7f7$
Bonjour,
Copie cette macro dans un module standard et exécute-la une fois Est-ce que cela a un effet positif sur le poids de ton fichier?
'------------------------------------------------------------------ Sub test() Dim Sh As Worksheet, DerLig As Long, DerCol As Integer Dim ModeCalcul As String
Application.ScreenUpdating = False ModeCalcul = Application.Calculation Application.Calculation = xlCalculationManual Application.EnableEvents = False On Error Resume Next For Each Sh In ThisWorkbook.Worksheets With Sh If Not IsEmpty(.UsedRange) Then DerLig = .Cells.Find(What:="*", _ LookIn:=xlFormulas, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
DerCol = .Cells.Find(What:="*", _ LookIn:=xlFormulas, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious).Column .Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count, .Columns.Count)).Clear .Range(.Cells(1, DerCol + 1), .Cells(.Rows.Count, .Columns.Count)).Delete .Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count, .Columns.Count)).Clear .Range(.Cells(DerLig + 1, 1), .Cells(.Rows.Count, .Columns.Count)).Delete End If End With If Err <> 0 Then Err = 0 Next Application.Calculation = ModeCalcul Application.EnableEvents = True Application.ScreenUpdating = True End Sub '------------------------------------------------------------------