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.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,523
Messages
5,854,211
Members
431,627
Latest member
mantesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top