|
▼dona さん:
おはようございます。
Application.Runメソッドを使用すると可能です。
新規ブックの標準モジュールに
'==================================================================
Sub main()
Dim pnmarray As Variant
Dim idx As Long
On Error Resume Next
Range("a1:a3").Value = Application.Transpose(Array("abc", "def", "ghi"))
'↑サンプルデータの作成
pnmarray = Range("a1", Cells(Rows.Count, "a").End(xlUp)).Value
For idx = LBound(pnmarray, 1) To UBound(pnmarray, 1)
Err.Clear
Application.Run pnmarray(idx, 1)
If Err.Number <> 0 Then
MsgBox Err.Description
End If
Next
On Error GoTo 0
End Sub
'==================================================================
Sub abc()
MsgBox "abc"
End Sub
'==================================================================
Sub def()
MsgBox "def"
End Sub
'==================================================================
Sub ghi()
MsgBox "ghi"
End Sub
でmainを実行してみて下さい
|
|