Results 1 to 3 of 3

Progress meter

Threaded View

  1. #1
    Registered User
    Join Date
    08-20-2007
    Posts
    60

    Progress meter

    Hello,

    I am doing data extraction processing and calculations - it takes a while. I would like to show a progress meter. I found some interesting progress meters at

    http://www.andypope.info/vba/pmeter.htm'

    Here is teh code:

    
    Private Sub UserForm_Click()
    
    '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    'Progress bar'
    '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    
    Sub progress()
    
    Dim intIndex As Integer
    Dim sngPercent As Single
    Dim intMax As Integer
    
    intMax = 100
    For intIndex = 1 To intMax
        sngPercent = intIndex / intMax
        ProgressStyle5 sngPercent
        ProgressStyle6 sngPercent
        DoEvents
        '------------------------
        ' Your code would go here
        '------------------------
    Sleep 100
    Next
    
    Public Sub ProgressStyle5(Percent As Single)
    '
    ' Progress Style 5
    ' Label Over Label changing text content
    ' Growth
    
    
        Dim strTemp As String
        Dim intIndex As Integer
        
        intIndex = Int(Len(UserForm2.labPg5a.Caption) * Percent)
        If intIndex > 0 Then
            strTemp = String(intIndex, "•") & String(Len(UserForm2.labPg5a.Caption) - intIndex, " ")
        Else
            strTemp = String(Len(UserForm2.labPg5a.Caption), " ")
        End If
        UserForm2.labPg5.Caption = strTemp
        
    End Sub
    Public Sub ProgressStyle6(Percent As Single)
    '
    ' Progress Style 6
    ' Label Over Label changing text content
    ' Pulsing
    '
        Dim strTemp As String
        Dim intIndex As Integer
        
        intIndex = Int((Percent * 100) Mod (Len(UserForm2.labPg6a.Caption) + 1))
        strTemp = String(Len(UserForm2.labPg6a.Caption), " ")
        If intIndex > 0 Then
            Mid(strTemp, intIndex, 1) = "•"
        End If
        UserForm2.labPg6.Caption = strTemp
        
    End Sub
    
    End Sub

    I am not sure how to incorporate this into my macro. Do I need to put the code in the progress meter form or do I need to combine it with the codes in module? I don't understand how progress meter and macro runs parallely. Please help.

    Thanks, Anil
    Last edited by akabraha; 08-30-2007 at 01:42 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1