Possible to loop through control box?

largeselection

Active Member
Joined
Aug 4, 2008
Messages
353
Hi again,

I have a chart which shows revenue by salesman for a month. Basically I have a dropdown control which lists the names of 12 different sets of data. So I can choose Jan, Feb, Mar, etc and based on my selection it will update the data in a range and then adjust the chart based on that range (which has been updated).

So I can click in the dropdown and select Jan, then Feb, then Mar and see how the salesman performance flows month by month.

Is there a way to automate it like a slideshow?

So it would be first in the control dropdown, show for 5 seconds, then second in the control dropdown, show for 5 seconds, then third, etc. so I don't have to manually keep clicking the control to select the next one. It would be less distracting if I could show it ala a slideshow.
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

ChrisOswald

Active Member
Joined
Jan 19, 2010
Messages
454
Hi,
without knowing more about your dropdown (is it in a userform, data validation list), I can't give a specific answer.

with that caveat, you should be able to do something.

Code:
Sub StartMySlide()
    Dim i As Long
 
    For i = 1 To 12
        'assuming you're using a data validation drop down based in cell A1.
        Cells(1, 1) = Format(i & "/01/2000", "mmm")
 
        'if the drop down (called mycontrol) is in a form (called myfrm) , you'd do something like
        'myfrm.mycontrol.Value = Format(i & "/01/2000", "mmm")
 
        'I hardly ever use charts, so I'm not certain if there is any sort of
        ' 'refresh' command needed.
        Application.Wait (Now + TimeValue("0:00:05"))
    Next i
 
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,099,535
Messages
5,469,260
Members
406,645
Latest member
jasondabsher

This Week's Hot Topics

Top