Excel VBA セル内容の読み上げ
Public Function spk(ByVal Target As Range)
On Error GoTo Myerror
If Not IsError(Target.Value) And TypeName(Target.Value) <> "Variant()" And Target.Value <> "" Then
Dim arr() As String
Dim i As Long
Dim leng As Long
leng = Len(Target.Value)
ReDim arr(leng - 1)
For i = 0 To leng - 1
arr(i) = Mid(Target.Value, i + 1, 1)
Next i
For Each x In arr
Select Case Asc(x)
Dim sv As String
Case 47 To 58
sv = "数字の "
Case 64 To 91
sv = "大文字の "
Case 96 To 123
sv = "小文字の "
End Select
Application.Speech.Speak sv & x, "True"
Next x
End If
Myerror:
Debug.Print "Myerror"
End Function
0 件のコメント:
コメントを投稿