Sub Macro0430()
Dim re As Integer
re = MsgBox(“シート名を変更していいですか?”, vbOKCancel, _
“シート名変更”)
If re = vbOK Then ActiveSheet.Name = “mySheet”
End Sub



Just another WordPress site
Sub Macro0430()
Dim re As Integer
re = MsgBox(“シート名を変更していいですか?”, vbOKCancel, _
“シート名変更”)
If re = vbOK Then ActiveSheet.Name = “mySheet”
End Sub



Sub ExStatement()
MsgBox “このデータを削除しますか?”, vbYesNo + _
vbQuestion + vbDefaultButton2
End Sub

Sub ExStatement()
MsgBox Prompt:=”その操作はできません”, Title:=”警告”
End Sub
msgbox 関数の構文
msgbox(prompt,buttons,title,helpfile,context)

Sub Macro0429()
Dim myArray() As Variant
Dim s As Variant
myArray = Array(10, 20, 30)
For Each s In myArray
MsgBox s
Next s
End Sub

Sub Macro0428()
Dim wb As Workbook, s As Worksheet
For Each wb In Workbooks
For Each s In wb.Worksheets
s.Name = “作業用資料” & s.Index
Next s
Next wb
End Sub