Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2007
    Location
    Vienna, Wien, Austria
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow

    Hello,

    at least to my latest Question, my chief asked me to get a traffic ligt into a userform (my progressbar).
    As You can see in the attached file, i got 4 conditions (4 pictures..) - See worksheet "Konsolidierung" .
    Well, the question comes out from some "famous" (as I guess infamous)
    SAP reports, where a lot of traffic lights are shown. I got a solution in one of my former posts to connect cell values to shapes, but I donīt know
    how to make pictures visible or invisible on some conditions whilst a progress takes place.

    Has someone experience with this?

    Stef
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Add the following to the UserForm_Initialize event procedure of frmProgress:

    Code:
    	Dim i As Integer
    	For i = 3 To 5
    	  Me.Controls("Image" & i).Visible = False
    	Next i
    This will hide the green, yellow and red traffic lights initially.

    Add the following to AddDataToWKS, below the line dblProgress = dblProgress + dblStep:

    Code:
    		If dblProgress < 0.1 Then
    		  ' Nothing
    		ElseIf dblProgress < 0.5 Then
    		  frmProgress.Image2.Visible = False
    		  frmProgress.Image3.Visible = True
    		ElseIf dblProgress < 0.8 Then
    		  frmProgress.Image3.Visible = False
    		  frmProgress.Image4.Visible = True
    		Else
    		  frmProgress.Image4.Visible = False
    		  frmProgress.Image5.Visible = True
    		End If
    and similar under the line dblProgress = dblProgress + dblStep2. This will make the various traffic lights visible depending on the value of dblProgress.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2007
    Location
    Vienna, Wien, Austria
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cool, thank You!

    That seems to be easier than try it with shapes, eh?


    Stef

Posting Permissions

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