H
h2fcell
Hello,
I have a button on the “Quick Access Toolbar†of an Excel 2007 workbook that
starts a slide show and loops through 8 sheets continuously until a linked
cell equals 39. I would like to add another button to the “Quick Access
Toolbar†that stops the running slide show like Ctrl-Break does without the
Visual Basic window popping up with the message “Code execution has been
interruptedâ€.
Any suggestions?
Below is my code.
Sub SlideShow()
Worksheets(Array(1, 2, 3, 4, 5, 6, 7, 8)).Select
ActiveWindow.DisplayWorkbookTabs = False
ActiveWindow.DisplayHeadings = False 'Remove Row & Column headings
Application.DisplayFormulaBar = False
Do While Worksheets("TOTAL").Range("C42").Value <> 39
Refresh
Sheets("Sheet1").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet2").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet3").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet4").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet5").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet6").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet7").Select
Range("A1").Select
Pause
Refresh
Sheets("TOTAL").Select
Range("A1").Select
Pause
Loop
End Sub
I have a button on the “Quick Access Toolbar†of an Excel 2007 workbook that
starts a slide show and loops through 8 sheets continuously until a linked
cell equals 39. I would like to add another button to the “Quick Access
Toolbar†that stops the running slide show like Ctrl-Break does without the
Visual Basic window popping up with the message “Code execution has been
interruptedâ€.
Any suggestions?
Below is my code.
Sub SlideShow()
Worksheets(Array(1, 2, 3, 4, 5, 6, 7, 8)).Select
ActiveWindow.DisplayWorkbookTabs = False
ActiveWindow.DisplayHeadings = False 'Remove Row & Column headings
Application.DisplayFormulaBar = False
Do While Worksheets("TOTAL").Range("C42").Value <> 39
Refresh
Sheets("Sheet1").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet2").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet3").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet4").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet5").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet6").Select
Range("A1").Select
Pause
Refresh
Sheets("Sheet7").Select
Range("A1").Select
Pause
Refresh
Sheets("TOTAL").Select
Range("A1").Select
Pause
Loop
End Sub