Saludos Dante a continuación te envío el código,.
Los problemas que me dan son:
Se ejecuta el PROGRESS BAR CODES muy rápido y no tiene ninguna relación con la ejecución de borrar y por supuesto me gustaría ver el por ciento de ejecución del borrado de la hoja
Gracias
Eusebio
Private Sub CommandButton3_Click()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
ActiveSheet.DisplayPageBreaks = False
Pass = "chevo"
Sheets("MKP").Unprotect "chevo"
If ListBox1.ListIndex >= 0 Then
cevap = MsgBox("Eintrag wird gelöscht. ... Sind Sie sicher ?", vbYesNo, "")
End If
Call Main 'Progress Bar
MsgBox "Die Daten werden gelöscht, Bitte haben etwas Geduld", vbApplicationModal, ""
Sheets("MKP").Range("A2:F10000,G2:M10000,O2:AD10000,DS2:DS10000,Ay2:BH10000,DB2:DH10000,Dj2:DQ10000,AO2:AS10000,DU2:DY10000,EE2:EE10000,EH2.EL10000,FS2.FS10000,FW2:FW10000").ClearContents
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
ActiveSheet.DisplayPageBreaks = True
Application.CutCopyMode = False
End Sub
PROGRESS BAR CODES
Sub Main()
Dim I, tot As Integer
tot = 5000
For I = 1 To tot
If I Mod 5 = 0 Then
ProgressBar I / tot
End If
Next I
lblDone.Width = 0
lblPct.Visible = False
End Sub
Sub ProgressBar(PctDone As Single)
lblDone.Width = PctDone * (lblRemain.Width - 2)
lblPct.Visible = True
lblPct.Caption = Format(PctDone, "0%")
DoEvents
End Sub