Sub ResetCursorAndZoom()
Dim ws As Object
Dim defaultSheet As Object
Set defaultSheet = ActiveSheet
For Each ws In ActiveWorkbook.Sheets
ws.Activate
ActiveSheet.Range("A1").Select
ActiveWindow.Zoom = 100
Next ws
defaultSheet.Activate
End Sub
Sub いまいち()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Activate
ws.Range("A1").Select
Next
Set ws = Nothing
End Sub
MsgBox ExecuteExcel4Macro("'C:\[Book1.xls]Sheet1'!R1C1")
Sub Sample3()
Dim i As Long, buf As String, Target As String
Const Path = "C:\データ\"
buf = Dir(Path & "*.xls")
Do While buf <> ""
Target = "'" & Path & "[" & buf & "]Sheet1'!R1C1"
i = i + 1
Cells(i, 1) = buf
Cells(i, 2) = ExecuteExcel4Macro(Target)
buf = Dir()
Loop
End Sub