Possible to loop through control box?

largeselection

Active Member
Joined
Aug 4, 2008
Messages
358
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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,186
Members
449,071
Latest member
cdnMech

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
Back
Top