Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin ?
Merci de votre aide.
--
Cordialement
Guy
Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin ?
Merci de votre aide.
--
Cordialement
Guy
Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin ?
Merci de votre aide.
--
Cordialement
Guy
Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien ,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" a écrit dans le message de
news:u9k0%Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin
?
Merci de votre aide.
--
Cordialement
Guy
Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien amicordi@lement,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" <guy72@bonjour.tous> a écrit dans le message de
news:u9k0%23tqLJHA.5648@TK2MSFTNGP05.phx.gbl...
Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin
?
Merci de votre aide.
--
Cordialement
Guy
Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien ,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" a écrit dans le message de
news:u9k0%Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin
?
Merci de votre aide.
--
Cordialement
Guy
Je suis arrêté à la ligne "Next Sht"
Bonjour Patrick
J'ai une feuille.
Le fichier fait 2200 Ko
--
Cordialement
Guy
"Patrick BASTARD" a écrit dans le
message de news: %Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien ,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" a écrit dans le message de
news:u9k0%Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin
?
Merci de votre aide.
--
Cordialement
Guy
Je suis arrêté à la ligne "Next Sht"
Bonjour Patrick
J'ai une feuille.
Le fichier fait 2200 Ko
--
Cordialement
Guy
"Patrick BASTARD" <patrick.bastard@dbmail.com.invalid> a écrit dans le
message de news: %23t8TC2qLJHA.5060@TK2MSFTNGP02.phx.gbl...
Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien amicordi@lement,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" <guy72@bonjour.tous> a écrit dans le message de
news:u9k0%23tqLJHA.5648@TK2MSFTNGP05.phx.gbl...
Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin
?
Merci de votre aide.
--
Cordialement
Guy
Je suis arrêté à la ligne "Next Sht"
Bonjour Patrick
J'ai une feuille.
Le fichier fait 2200 Ko
--
Cordialement
Guy
"Patrick BASTARD" a écrit dans le
message de news: %Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien ,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" a écrit dans le message de
news:u9k0%Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin
?
Merci de votre aide.
--
Cordialement
Guy
Bonjour Patrick
J'ai une feuille.
Le fichier fait 2200 Ko
--
Cordialement
Guy
"Patrick BASTARD" a écrit dans le
message de news: %Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien ,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" a écrit dans le message de
news:u9k0%Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin
?
Merci de votre aide.
--
Cordialement
Guy
Bonjour Patrick
J'ai une feuille.
Le fichier fait 2200 Ko
--
Cordialement
Guy
"Patrick BASTARD" <patrick.bastard@dbmail.com.invalid> a écrit dans le
message de news: %23t8TC2qLJHA.5060@TK2MSFTNGP02.phx.gbl...
Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien amicordi@lement,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" <guy72@bonjour.tous> a écrit dans le message de
news:u9k0%23tqLJHA.5648@TK2MSFTNGP05.phx.gbl...
Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin
?
Merci de votre aide.
--
Cordialement
Guy
Bonjour Patrick
J'ai une feuille.
Le fichier fait 2200 Ko
--
Cordialement
Guy
"Patrick BASTARD" a écrit dans le
message de news: %Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien ,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" a écrit dans le message de
news:u9k0%Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en magasin
?
Merci de votre aide.
--
Cordialement
Guy
Bonjour,
Il semble qu'i manque un End If avant Next Sht
--
Cordialement
"Guy72" a écrit dans le message de
news:ewZVW%Bonjour Patrick
J'ai une feuille.
Le fichier fait 2200 Ko
--
Cordialement
Guy
"Patrick BASTARD" a écrit dans le
message de news: %Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien ,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" a écrit dans le message de
news:u9k0%Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en
magasin ?
Merci de votre aide.
--
Cordialement
Guy
Bonjour,
Il semble qu'i manque un End If avant Next Sht
--
Cordialement
jpmonnier-nospam@neuf.fr
"Guy72" <guy72@bonjour.tous> a écrit dans le message de
news:ewZVW%23qLJHA.5232@TK2MSFTNGP02.phx.gbl...
Bonjour Patrick
J'ai une feuille.
Le fichier fait 2200 Ko
--
Cordialement
Guy
"Patrick BASTARD" <patrick.bastard@dbmail.com.invalid> a écrit dans le
message de news: %23t8TC2qLJHA.5060@TK2MSFTNGP02.phx.gbl...
Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien amicordi@lement,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" <guy72@bonjour.tous> a écrit dans le message de
news:u9k0%23tqLJHA.5648@TK2MSFTNGP05.phx.gbl...
Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en
magasin ?
Merci de votre aide.
--
Cordialement
Guy
Bonjour,
Il semble qu'i manque un End If avant Next Sht
--
Cordialement
"Guy72" a écrit dans le message de
news:ewZVW%Bonjour Patrick
J'ai une feuille.
Le fichier fait 2200 Ko
--
Cordialement
Guy
"Patrick BASTARD" a écrit dans le
message de news: %Bonjour, Guy72.
Combien de feuilles dans ton classeur ?
--
Bien ,
Patrick BASTARD
patrick.bastardchezdbmail.com
"Guy72" a écrit dans le message de
news:u9k0%Bonjour,
Je voulais voir si mon fichier avait besoin d'un régime.
J'avais gardé sous le coude cette macro (je ne sais pas ou je l'ai
récupéré).
Mais ça ne fonctionne pas.
Je suis arrêté à la ligne "Next Sht"
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range, Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)).EntireRow.Clear
Set DCell = Nothing
Set DCell = Sht.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.[IV1]).EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
Pouvez-vous voir ce qui cloche, ou si vous avez la même chose en
magasin ?
Merci de votre aide.
--
Cordialement
Guy
Non ça ne fonctionne pas, ça enlève tout, donc pas fiable.
Non ça ne fonctionne pas, ça enlève tout, donc pas fiable.
Non ça ne fonctionne pas, ça enlève tout, donc pas fiable.
Non ça ne fonctionne pas, ça enlève tout, donc pas fiable.
Non ça ne fonctionne pas, ça enlève tout, donc pas fiable.
Non ça ne fonctionne pas, ça enlève tout, donc pas fiable.
Il y a encore une petite coquille sur la procédure transmise.
Correction apportée : ceci devrait fonctionner.
'-------------------------------------------------
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range
Dim DxCell As Range
Dim Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or _
Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", _
, xlFormulas, , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)). _
EntireRow.Clear
Set DCell = Nothing
Set DxCell = Sht.Cells.Find("*", , xlFormulas, _
, xlByColumns, xlPrevious)(2)
If Not DxCell Is Nothing Then
Sht.Range(DxCell.Offset(, 1), Sht.[IV1]). _
EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
'-------------------------------------------------
Il y a encore une petite coquille sur la procédure transmise.
Correction apportée : ceci devrait fonctionner.
'-------------------------------------------------
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range
Dim DxCell As Range
Dim Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or _
Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", _
, xlFormulas, , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)). _
EntireRow.Clear
Set DCell = Nothing
Set DxCell = Sht.Cells.Find("*", , xlFormulas, _
, xlByColumns, xlPrevious)(2)
If Not DxCell Is Nothing Then
Sht.Range(DxCell.Offset(, 1), Sht.[IV1]). _
EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
'-------------------------------------------------
Il y a encore une petite coquille sur la procédure transmise.
Correction apportée : ceci devrait fonctionner.
'-------------------------------------------------
Sub Nettoie()
' Macro enregistrée Laurent Longre
Dim Sht As Worksheet, DCell As Range
Dim DxCell As Range
Dim Calc As Long, Rien As String
On Error Resume Next
Calc = Application.Calculation
With Application
.Calculation = xlCalculationManual
.StatusBar = "Nettoyage en cours"
.EnableCancelKey = xlErrorHandler
.ScreenUpdating = False
End With
For Each Sht In Worksheets
If Sht.UsedRange.Address <> "$A$1" Or _
Not IsEmpty(Sht.[A1]) Then
Set DCell = Sht.Cells.Find("*", _
, xlFormulas, , xlByRows, xlPrevious)(2)
If Not DCell Is Nothing Then
Sht.Range(DCell, Sht.Cells([A:A].Count, 1)). _
EntireRow.Clear
Set DCell = Nothing
Set DxCell = Sht.Cells.Find("*", , xlFormulas, _
, xlByColumns, xlPrevious)(2)
If Not DxCell Is Nothing Then
Sht.Range(DxCell.Offset(, 1), Sht.[IV1]). _
EntireColumn.Clear
End If
Rien = Sht.UsedRange.Address
End If
End If
Next Sht
Application.StatusBar = False
Application.Calculation = Calc
End Sub
'-------------------------------------------------