ExcelのValue関数の使い方|文字列を数値に変換する|Office Hack

マクロ実行時の処理時間を短縮するコードをご教授お願い致します。 フォルダ内の複数あるブックの合計を1つのブックにまとめたコードなのですが、 下記コードは参照セル数6か所なのですが実際は36か所ある為、コード実行処理 時間が5~6秒くらいかかります、色々検索したのですが、なかなか理解できず、 困ってしまいました、下記コードの処理時間を短縮できるコードに書き換え可能 な方、宜しくお願い致します。 ※total2, total4, total6をはぶいたコードでも大丈夫です。 Sub 処理時間短縮() Dim myPath As String, myFile As String, x As Variant, total1 As Variant, total2 As Variant, total3 As Variant, total4 As Variant, total5 As Variant, total6 As Variant myPath = myFile = Dir(myPath & "\**") Do Until myFile = "" x = ExecuteExcel4Macro("'" & myPath & "\[" & myFile & "]集計'! R3C6") If IsNumeric(x) Then total1 = total1 + x End If x = ExecuteExcel4Macro("'" & myPath & "\[" & myFile & "]集計'! R4C6") If IsNumeric(x) Then total2 = total2 + x End If x = ExecuteExcel4Macro("'" & myPath & "\[" & myFile & "]集計'! サービス終了のお知らせ. R3C15") If IsNumeric(x) Then total3 = total3 + x End If x = ExecuteExcel4Macro("'" & myPath & "\[" & myFile & "]集計'! R4C15") If IsNumeric(x) Then total4 = total4 + x End If x = ExecuteExcel4Macro("'" & myPath & "\[" & myFile & "]計算シート21'!

  1. サービス終了のお知らせ

サービス終了のお知らせ

はい いいえ

行見出し 2.

June 1, 2024, 7:14 pm