暂停模块,直到用户单击提交以继续 运行 该模块

Pausing a module, until user clicks submit to continue running the module

我正在创建一个用户界面,用户可以在其中单击工作表上的 "click to select" 按钮,它会调用 运行 模块 1 到某个点,存储信息,暂停模块。模块 1 应仅在用户单击工作表上的提交按钮后 运行ning 继续。


更新!!

它不仅是 1 个模块。它实际上有 6 个模块。其中,提交按钮必须继续,paused/stopped。无论如何,我可以 link 提交按钮到 6 个不同的模块?

Sub FlowRate()

    Set chwflow_rate1 = Application.InputBox("Please select 1st cell with
    Chilled Water Flowrate.", Type:=8)
    Range(chwflow_rate1, chwflow_rate1.Offset(20159)).Select
    Selection.Copy

  ' Program pause until user clicks submit button
  ' user click submit, program continues
    Workbooks(1).Activate
    Sheets("Data").Activate
    Range("C8").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    ActiveCell.EntireColumn.Offset(0, 1).Insert
    With ActiveSheet
        For I = 7 To Cells(.Rows.Count, "C").End(xlUp).Row
            aSplit = Split(Cells(I, "C"), " ", 8)
            Cells(I, "C") = aSplit(0)
            Cells(I, "D") = aSplit(1)
        Next I
    End With
    Range("D8").Select
    ActiveCell.EntireColumn.Delete 
 End Sub

像这样将功能拆分为两个单独的过程,并将提交按钮链接到 FlowRate Submit()。

Sub FlowRate()

    Set chwflow_rate1 = Application.InputBox("Please select 1st cell with
    Chilled Water Flowrate.", Type:=8)
    Range(chwflow_rate1, chwflow_rate1.Offset(20159)).Select
    Selection.Copy
End Sub

Sub FlowRateSubmit()

  ' Program pause until user clicks submit button
  ' user click submit, program continues
    Workbooks(1).Activate
    Sheets("Data").Activate
    Range("C8").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    ActiveCell.EntireColumn.Offset(0, 1).Insert
    With ActiveSheet
        For I = 7 To Cells(.Rows.Count, "C").End(xlUp).Row
            aSplit = Split(Cells(I, "C"), " ", 8)
            Cells(I, "C") = aSplit(0)
            Cells(I, "D") = aSplit(1)
        Next I
    End With
    Range("D8").Select
    ActiveCell.EntireColumn.Delete 
 End Sub