1
내 통합 문서의 모든 파일에서 작동하는 매크로이며 시트가 표시되어 있으면 랩 의 매크로를 실행합니다. 나는 레이블이있는 사용자 정의 폼을 사용하는 것과 동일한 들어매크로를 실행하는 동안 진행률 표시 줄
Sub execute()
Application.ScreenUpdating = False
Application.Cursor = xlWait
' makes sure that the statusbar is visible
Application.DisplayStatusBar = True
'add your message to status bar
Application.StatusBar = "Formatting Report..."
userform1.show
Call Delete_EmptySheets
Dim WS_Count As Integer
Dim i As Worksheet
' Set WS_Count equal to the number of worksheets in the active
' workbook.
WS_Count = ActiveWorkbook.Worksheets.Count
' Begin the loop.
For Each i In Worksheets
If Not i.Visible = xlSheetVeryHidden Then
i.Select
Call wrap
End If
Next i
Application.Cursor = xlDefault
' gives control of the statusbar back to the programme
Application.StatusBar = False
Application.ScreenUpdating = True
End Sub
.. 매크로가 실행되는 동안 진행률을 표시하는 진행률 표시 줄을 보여주고 싶었다하지만 그것은 단지 앞이나 매크로 후 실행 실행
Private Sub UserForm_Activate()
Call ShowProgressBarWithoutPercentage
End Sub
Sub ShowProgressBarWithoutPercentage()
Dim Percent As Integer
Dim PercentComplete As Single
Dim MaxRow, MaxCol As Integer
Dim iRow, iCol As Integer
MaxRow = 500
MaxCol = 500
Percent = 0
'Initially Set the width of the Label as Zero
UserForm1.Label1.Width = 0
For iRow = 1 To MaxRow
For iCol = 1 To MaxCol
Worksheets("Sheet1").Cells(iRow, iCol).Value = iRow * iCol
Next
PercentComplete = iRow/MaxRow
UserForm1.Label1.Width = PercentComplete * UserForm1.Width
Next
Unload UserForm1
End Sub
매크로가 백그라운드에서 실행될 때 진행률 표시 방법을 보여줄 수 있습니까?
문제가 ** ** 제 UserForm1을 실행한다는 것이다. 진행률 막대가 가득 차면 루프가 시작됩니다. 나는 둘 다 동시에 일어나고 진행 바를 루프의 진행 상황을 보여주기를 원한다. – Cprog