ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Excel ¼½©ñ¥|­Ó¤À­¶

¦^´_ 2# fantersy
¥H¤U©ñ¦bThisWorkbook , ¶}Àɮ׮ɩw¸q¦n¼öÁä
  1. Private Sub Workbook_Open()
  2.     Application.OnKey "^+a", "AutoPlay"     'Ctrl + Shift + a  ¶}©l
  3.     Application.OnKey "^+s", "StopPlay"     'Ctrl + Shift + s  °±¤î
  4. End Sub
½Æ»s¥N½X
¥H¤U©ñ¦b¤@¯ë¼Ò²Õ
  1. Private inPlay As Boolean
  2. Private nextTime As Date
  3. Private index As Long
  4. Sub AutoPlay()
  5.     StopPlay    'stop previous schedule
  6.    
  7.     inPlay = True
  8.     index = 1
  9.     LoopDisplaySheet
  10. End Sub
  11. Sub StopPlay()
  12.     If inPlay Then
  13.         Application.OnTime nextTime, "LoopDisplaySheet", , False    '¨ú®ø¤w¦s¦b±Æµ{
  14.         inPlay = False
  15.     End If
  16. End Sub
  17. Sub LoopDisplaySheet()
  18.     Application.Goto Sheets(index).Range("A1"), True
  19.    
  20.     If index = Sheets.Count Then
  21.         Exit Sub
  22.     Else
  23.         nextTime = Now + TimeValue("00:00:01")
  24.         index = index + 1
  25.         Application.OnTime nextTime, "LoopDisplaySheet"
  26.     End If
  27. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 5# fantersy
  1. Private nextTime As Date
  2. Private index As Long
  3. Sub AutoPlay()
  4.     StopPlay    'stop previous schedule
  5.    
  6.     index = 0
  7.     LoopDisplaySheet
  8. End Sub
  9. Sub StopPlay()
  10.     On Error Resume Next
  11.     Application.OnTime nextTime, "LoopDisplaySheet", , False    '¨ú®ø¤w¦s¦b±Æµ{
  12. End Sub
  13. Sub LoopDisplaySheet()
  14.     Dim arSheets
  15.     arSheets = Array("¤u§@ªí1", "¤u§@ªí2", "¤u§@ªí3")
  16.    
  17.     Application.Goto Sheets(arSheets(index)).Range("A1"), True
  18.    
  19.     If index = UBound(arSheets) Then
  20.         index = 0
  21.     Else
  22.         index = index + 1
  23.     End If
  24.         
  25.     nextTime = Now + TimeValue("00:00:01")
  26.     Application.OnTime nextTime, "LoopDisplaySheet"
  27. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

        ÀR«ä¦Û¦b : ¹ï¤÷¥À­nª¾®¦¡A·P®¦¡B³ø®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD