Dim f As Boolean
Sub YomageStop()
f = False
‘MsgBox “”
End Sub
Sub Start()
Dim naiyou As String
Dim i As Integer
Dim x As Integer
f = True
If ActiveCell.Value <> “” Then
While f
DoEvents
naiyou = ActiveCell.Value
Select Case ActiveCell.Column
Case 2 ‘左の年月日
DoEvents
Speak2 (naiyou)
Selection.Offset(0, 6).Select ‘入力位置へ
Case 8, 11, 14 ‘1個進む
DoEvents
Speak (naiyou)
Selection.Offset(0, 1).Select
Case 9, 12, 15 ‘2個進む
DoEvents
Speak (naiyou)
Selection.Offset(0, 2).Select
Case 17 ‘最後のセルで最初に戻り中断
DoEvents
Speak (naiyou)
Application.Goto Reference:=Cells(ActiveCell.Row + 1, 2), Scroll:=False
naiyou = ActiveCell.Value
Speak2 (naiyou)
f = False
End Select
Wend
Else
MsgBox “読み上げる開始位置のセルを指定してください”
End If
End Sub
Private Sub CommandButton1_Click()
Sheet1.Start
End Sub
Private Sub CommandButton2_Click()
Sheet1.YomageStop
End Sub
Private Sub UserForm_Initialize()
With UserForm1
.StartUpPosition = 0
.Top = 0
.Left = 0
End With
CommandButton2.Accelerator = “Z”
CommandButton1.Accelerator = “X”
Dim x As Integer
For x = -10 To 10
ComboBox1.AddItem x
Next x
End Sub
Option Explicit
Private Declare Function SetFocus Lib “user32” (ByVal hwnd As Long) As Long
Private Sub Workbook_Open()
Application.OnKey “{ENTER}”, “Sheet1.MoveToStart”
UserForm1.Show vbModeless
‘シートにフォーカスを移す
SetFocus Application.hwnd
End Sub
SV.Rate = UserForm1.Controls(“ComboBox1”).Value