+ Reply to Thread
Results 1 to 6 of 6

How to make vertical progress bar?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    251

    Post How to make vertical progress bar?

    Hi,

    I use this code below to run horizontal progress bar.
    is there any code how to make Vertical Progress Bar, please?
    Option Explicit
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    
    Sub DemoProgress1()
        Dim intIndex As Integer
        Dim sngPercent As Single
        Dim intmax As Integer
        intmax = 100
        For intIndex = 1 To intmax
            sngPercent = intIndex / intmax
            ProgressStyle1 sngPercent, True
            DoEvents
            Sleep 100
        Next
    End Sub
    
    Sub ProgressStyle1(Percent As Single, ShowValue As Boolean)
        Label1.Width = Int(Label1.Tag * Percent)
    End Sub
    
    Private Sub CommandButton1_Click()
        DemoProgress1
    End Sub
    
    Private Sub UserForm_Initialize()
        Label1.Tag = Label1.Width
        Label1.Width = 0
    End Sub
    Thanks in advance for every small helps and efforts.

    Best Regards,
    Iqbal

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: How to make vertical progress bar?

    Iqbal

    Instead of increasing the width of the label, increase it's height.
    Sub ProgressStyle1(Percent As Single, ShowValue As Boolean)
        Label1.Height = Int(Label1.Tag * Percent)
    End Sub
    
    Private Sub UserForm_Initialize()
        Label1.Tag = Label1.Height
        Label1.Height = 0
    End Sub
    If posting code please use code tags, see here.

  3. #3
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to make vertical progress bar?

    If you want to progress from bottom-up, instead of top-down:
    Dim t As Long
    
    Sub ProgressStyle2(Percent As Single, ShowValue As Boolean)
        Label1.Move , t - Int(Label1.Tag * Percent), , Int(Label1.Tag * Percent)
    End Sub
    
    Private Sub UserForm_Initialize()
        Label1.Tag = Label1.Height
        t = Label1.Top + Label1.Height
        Label1.Height = 0
    End Sub
    多么想要告诉你 我好喜欢你

  4. #4
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    251

    Re: How to make vertical progress bar?

    Norie and Milz,

    Appreciated to all of your efforts Guys.
    It's working well.
    For the Norie code, the bar is starting from the top to the bottom.
    And for Milz code, yes..it's working from bottom to top.

    Again, big thanks to all of you Guys.
    I will add excellent reputation to all of you.

    Best Regards,
    Iqbal

  5. #5
    Registered User
    Join Date
    09-29-2014
    Location
    TIjuana, Mexico
    MS-Off Ver
    MSO 2010, MSO 2013
    Posts
    53

    Re: How to make vertical progress bar?

    Hi guys, quick question, this code works with a label in a Userform or the label is placed directly in the worksheet? I'm trying to make vertical down to up progress bars (I've achieved it in a userform) but I'd like to do it directly in the worksheet (ActiveX label)

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,000

    Re: How to make vertical progress bar?

    MarBoTJ,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 09-24-2013, 11:00 AM
  2. trying to make Vertical-Horizontal Flip....but how ?
    By VICTOR5 in forum Excel General
    Replies: 1
    Last Post: 12-16-2012, 07:04 AM
  3. [SOLVED] Can I make a chart that is vertical instead of horizontal?
    By Karvis in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-02-2006, 02:15 PM
  4. how can i make excel from vertical to horizontal?
    By Mariaepa in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-02-2006, 12:25 PM
  5. How to make Horizontal data go Vertical
    By tx12345 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-23-2005, 11:45 PM

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