Excel VBA

Hello world!

WordPress へようこそ。こちらは最初の投稿です。編集または削除し、コンテンツ作成を始めてください。

Sub sample1()
  Dim i As Long
  Dim strDir As String
  Dim strFile As String
  
  Debug.Print Timer
  Application.ScreenUpdating = False
  strDir = ThisWorkbook.Path & "\test\"
  strFile = Dir(strDir)
  i = 1
  Do While strFile <> ""
    Cells(i, 1) = ExecuteExcel4Macro("'" & strDir & "[" & strFile & "]Sheet1'!R1C1")
    strFile = Dir()
    i = i + 1
  Loop
  Application.ScreenUpdating = True
  Debug.Print Timer
End Sub

# 1+2+3+...+1000000 の実行時間を計測

%%time

k = 0

for x in range(10**6):
    k += x

print(k)

-Excel VBA