【vba】 Processing Bar의 예

3382 단어 VBAVBA 매크로

' ********************************************************************************************
' Progress character string creation  Process
' Ex :Application.StatusBar = "Processing ..." & GetProgressString(counter, Max) & "@" & param
' ********************************************************************************************
Public Function GetProgressString(current, max) As String
    If current > max Then
        MsgBox "<GetProgressString> Error : " & "current > max value NG", vbCritical, "Error Message"
        Exit Function
    End If
    Dim progress As String
    Dim rate As Long
    ' Calc %
    rate = (current / max * 100) \ 10
    ' ■■■■■□□□□□
    progress = String(rate, GetMsg(LANGUAGE_KBN, 6)) & String(10 - rate, GetMsg(LANGUAGE_KBN, 7))
    GetProgressString = " " & progress & "[" & current & "/" & max & "]"
End Function

좋은 웹페이지 즐겨찾기