Bonjour,
J'ai crée la macro suivante afin de faire certains retraitements ( ouvrir un fichier excel dans une feuille, et copier son contenu suivant certaines valeurs dans 3 feuilles différentes, j'avoue que mon fichier est un peu volumineux donc le process prend du temps)
Je veux faire une barre de progression qui se termine une fois toutes les copies effectuées.
Puis-je avoir de l'aide ?
Merci
Voici ma macro
Sub ImportData()
Application.DisplayAlerts = False
Sheets("general_report").Cells.Clear
Sheets("general_report").Delete
Application.DisplayAlerts = True
Dim wBase As Workbook, wOuvert As Workbook, WS As Worksheet
Set wBase = ThisWorkbook
If Not Application.Dialogs(xlDialogOpen).Show Then Exit Sub
Set wOuvert = ActiveWorkbook
For Each WS In wOuvert.Worksheets
WS.Copy After:=wBase.Worksheets(wBase.Worksheets.Count)
Next WS
wOuvert.Close False
'********************************************Data sauvegarde**************************************
Dim LePath As String, LeNom As String, LePath2 As String
strDate = Format(Now, "dd-mm-yy hh-mm")
LePath2 = ActiveWorkbook.Path & "\Archive\"
Sheets("general_report").Copy
LeNom = strDate & ".xls"
ActiveWorkbook.SaveAs LePath2 & "Data " & LeNom
ActiveWorkbook.Close
'********************************************Retraitement******************************************
Sheets("general_report").Activate
Sheets("general_report").Rows(1).Delete
Sheets("general_report").Rows(2).Delete
Sheets("general_report").Rows(3).Delete
'Sheets("general_report").Rows(5).Delete
Sheets("general_report").Rows(1).Delete
Cells.Font.Size = 8
'***********************************Delivery Backlog**************************************************
Dim LLig As Long
Dim buffer, ligne
tablo = Sheets("general_report").UsedRange.Value
p = 2
i = 2
For l = 2 To UBound(tablo)
Sheets("general_report").Activate
buffer = Sheets("general_report").Cells(p, 12)
If buffer = "Done" Then
ligne = Sheets("general_report").Rows(p)
Sheets("Delivery Backlog").Activate
Sheets("Delivery Backlog").Rows(i) = ligne
i = i + 1
End If
p = p + 1
Next l
Sheets("Delivery Backlog").Activate
Cells.Font.Size = 8
'***********************************Backlog Catalogue**************************************************
' Dim LLig As Long
' Dim buffer, ligne
tablo = Sheets("general_report").UsedRange.Value
p = 2
i = 2
For l = 2 To UBound(tablo)
Sheets("general_report").Activate
buffer = Sheets("general_report").Cells(p, 12)
If buffer = "To Do" Or buffer = "General Spec Done" Or buffer = "Ready for Specification" Then
ligne = Sheets("general_report").Rows(p)
Sheets("Delivery Backlog").Activate
Sheets("Backlog Catalogue").Rows(i) = ligne
i = i + 1
End If
p = p + 1
Next l
Sheets("Backlog Catalogue").Activate
Cells.Font.Size = 8
'***********************************Used In Prod**************************************************
' Dim LLig As Long
' Dim buffer, ligne
tablo = Sheets("general_report").UsedRange.Value
p = 2
i = 2
For l = 2 To UBound(tablo)
Sheets("general_report").Activate
buffer = Sheets("general_report").Cells(p, 12)
If buffer = "USED IN PRODUCTION" Or buffer = "In Progress" Or buffer = "Peer review" Or buffer = "Dev - In Progress" Or buffer = "Prioritized" Or buffer = "PreUAT" Or buffer = "SIT" Then
ligne = Sheets("general_report").Rows(p)
Sheets("Used In Prod").Activate
Sheets("Used In Prod").Rows(i) = ligne
i = i + 1
End If
p = p + 1
Next l
Sheets("Used In Prod").Activate
Cells.Font.Size = 8
End Sub
J'ai crée la macro suivante afin de faire certains retraitements ( ouvrir un fichier excel dans une feuille, et copier son contenu suivant certaines valeurs dans 3 feuilles différentes, j'avoue que mon fichier est un peu volumineux donc le process prend du temps)
Je veux faire une barre de progression qui se termine une fois toutes les copies effectuées.
Puis-je avoir de l'aide ?
Merci
Voici ma macro
Sub ImportData()
Application.DisplayAlerts = False
Sheets("general_report").Cells.Clear
Sheets("general_report").Delete
Application.DisplayAlerts = True
Dim wBase As Workbook, wOuvert As Workbook, WS As Worksheet
Set wBase = ThisWorkbook
If Not Application.Dialogs(xlDialogOpen).Show Then Exit Sub
Set wOuvert = ActiveWorkbook
For Each WS In wOuvert.Worksheets
WS.Copy After:=wBase.Worksheets(wBase.Worksheets.Count)
Next WS
wOuvert.Close False
'********************************************Data sauvegarde**************************************
Dim LePath As String, LeNom As String, LePath2 As String
strDate = Format(Now, "dd-mm-yy hh-mm")
LePath2 = ActiveWorkbook.Path & "\Archive\"
Sheets("general_report").Copy
LeNom = strDate & ".xls"
ActiveWorkbook.SaveAs LePath2 & "Data " & LeNom
ActiveWorkbook.Close
'********************************************Retraitement******************************************
Sheets("general_report").Activate
Sheets("general_report").Rows(1).Delete
Sheets("general_report").Rows(2).Delete
Sheets("general_report").Rows(3).Delete
'Sheets("general_report").Rows(5).Delete
Sheets("general_report").Rows(1).Delete
Cells.Font.Size = 8
'***********************************Delivery Backlog**************************************************
Dim LLig As Long
Dim buffer, ligne
tablo = Sheets("general_report").UsedRange.Value
p = 2
i = 2
For l = 2 To UBound(tablo)
Sheets("general_report").Activate
buffer = Sheets("general_report").Cells(p, 12)
If buffer = "Done" Then
ligne = Sheets("general_report").Rows(p)
Sheets("Delivery Backlog").Activate
Sheets("Delivery Backlog").Rows(i) = ligne
i = i + 1
End If
p = p + 1
Next l
Sheets("Delivery Backlog").Activate
Cells.Font.Size = 8
'***********************************Backlog Catalogue**************************************************
' Dim LLig As Long
' Dim buffer, ligne
tablo = Sheets("general_report").UsedRange.Value
p = 2
i = 2
For l = 2 To UBound(tablo)
Sheets("general_report").Activate
buffer = Sheets("general_report").Cells(p, 12)
If buffer = "To Do" Or buffer = "General Spec Done" Or buffer = "Ready for Specification" Then
ligne = Sheets("general_report").Rows(p)
Sheets("Delivery Backlog").Activate
Sheets("Backlog Catalogue").Rows(i) = ligne
i = i + 1
End If
p = p + 1
Next l
Sheets("Backlog Catalogue").Activate
Cells.Font.Size = 8
'***********************************Used In Prod**************************************************
' Dim LLig As Long
' Dim buffer, ligne
tablo = Sheets("general_report").UsedRange.Value
p = 2
i = 2
For l = 2 To UBound(tablo)
Sheets("general_report").Activate
buffer = Sheets("general_report").Cells(p, 12)
If buffer = "USED IN PRODUCTION" Or buffer = "In Progress" Or buffer = "Peer review" Or buffer = "Dev - In Progress" Or buffer = "Prioritized" Or buffer = "PreUAT" Or buffer = "SIT" Then
ligne = Sheets("general_report").Rows(p)
Sheets("Used In Prod").Activate
Sheets("Used In Prod").Rows(i) = ligne
i = i + 1
End If
p = p + 1
Next l
Sheets("Used In Prod").Activate
Cells.Font.Size = 8
End Sub