调用多个子进程的进度条
Progress Bar for calling multiple sub
有什么方法可以在 Excel VBA 中创建 一个 Process Bar 作为调用多个 sub?每个 sub proximately 花了 10 分钟从一个文件复制并粘贴到这个工作簿。我想知道它已经处理了多长时间(完成百分比)。
我知道如果我有一个 for 循环进度,我可以为它应用进度条。不知道如何循环这样的东西。
Sub batch_import()
Call Import_NJ
Call Import_NY
Call Import_MD
Call Import_VA
Call Import_WV
Call Import_PA
Call Import_KY
Call Import_TN
Call Import_IN
Call Import_IA
Call Import_MI
Call Import_MO
Call Import_IL
Call Import_LW
End Sub
如果您总是有相同数量的订阅者可以调用(即确定的 14 个)。你可以做
Sub batch_import()
with Application
Call Import_NJ
.StatusBar = "Progress: " & Format(1 / 14, "0%")
Call Import_NY
.StatusBar = "Progress: " & Format(2 / 14, "0%")
Call Import_MD
.StatusBar = "Progress: " & Format(3 / 14, "0%")
Call Import_VA
.StatusBar = "Progress: " & Format(4 / 14, "0%")
Call Import_WV
.StatusBar = "Progress: " & Format(5 / 14, "0%")
Call Import_PA
.StatusBar = "Progress: " & Format(6 / 14, "0%")
Call Import_KY
.StatusBar = "Progress: " & Format(7 / 14, "0%")
Call Import_TN
.StatusBar = "Progress: " & Format(8 / 14, "0%")
Call Import_IN
.StatusBar = "Progress: " & Format(9 / 14, "0%")
Call Import_IA
.StatusBar = "Progress: " & Format(10 / 14, "0%")
Call Import_MI
.StatusBar = "Progress: " & Format(11 / 14, "0%")
Call Import_MO
.StatusBar = "Progress: " & Format(12 / 14, "0%")
Call Import_IL
.StatusBar = "Progress: " & Format(13 / 14, "0%")
Call Import_LW
.StatusBar = "Progress: " & Format(14 / 14, "0%")
.StatusBar =null
end with
End Sub
有什么方法可以在 Excel VBA 中创建 一个 Process Bar 作为调用多个 sub?每个 sub proximately 花了 10 分钟从一个文件复制并粘贴到这个工作簿。我想知道它已经处理了多长时间(完成百分比)。 我知道如果我有一个 for 循环进度,我可以为它应用进度条。不知道如何循环这样的东西。
Sub batch_import()
Call Import_NJ
Call Import_NY
Call Import_MD
Call Import_VA
Call Import_WV
Call Import_PA
Call Import_KY
Call Import_TN
Call Import_IN
Call Import_IA
Call Import_MI
Call Import_MO
Call Import_IL
Call Import_LW
End Sub
如果您总是有相同数量的订阅者可以调用(即确定的 14 个)。你可以做
Sub batch_import()
with Application
Call Import_NJ
.StatusBar = "Progress: " & Format(1 / 14, "0%")
Call Import_NY
.StatusBar = "Progress: " & Format(2 / 14, "0%")
Call Import_MD
.StatusBar = "Progress: " & Format(3 / 14, "0%")
Call Import_VA
.StatusBar = "Progress: " & Format(4 / 14, "0%")
Call Import_WV
.StatusBar = "Progress: " & Format(5 / 14, "0%")
Call Import_PA
.StatusBar = "Progress: " & Format(6 / 14, "0%")
Call Import_KY
.StatusBar = "Progress: " & Format(7 / 14, "0%")
Call Import_TN
.StatusBar = "Progress: " & Format(8 / 14, "0%")
Call Import_IN
.StatusBar = "Progress: " & Format(9 / 14, "0%")
Call Import_IA
.StatusBar = "Progress: " & Format(10 / 14, "0%")
Call Import_MI
.StatusBar = "Progress: " & Format(11 / 14, "0%")
Call Import_MO
.StatusBar = "Progress: " & Format(12 / 14, "0%")
Call Import_IL
.StatusBar = "Progress: " & Format(13 / 14, "0%")
Call Import_LW
.StatusBar = "Progress: " & Format(14 / 14, "0%")
.StatusBar =null
end with
End Sub