Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 如果复选框未选中,如何显示相邻单元格的值?_Excel_Vba - Fatal编程技术网

Excel 如果复选框未选中,如何显示相邻单元格的值?

Excel 如果复选框未选中,如何显示相邻单元格的值?,excel,vba,Excel,Vba,我不熟悉VBA宏。有一个提交项目要遵循的步骤列表,每个步骤在相邻单元格中都有一个复选框。如果复选框未选中,我想显示该值。我没有写任何代码。我是新来的。我需要帮助 是的,我想使用消息框显示在单击提交按钮后未选中的单元格值,如快照中所示 我写了这个模块,但是很长 Sub AllChecked() If Range("d3").Value = 18 Then MsgBox "Project ready for upload" End If If Range(

我不熟悉VBA宏。有一个提交项目要遵循的步骤列表,每个步骤在相邻单元格中都有一个复选框。如果复选框未选中,我想显示该值。我没有写任何代码。我是新来的。我需要帮助

是的,我想使用消息框显示在单击提交按钮后未选中的单元格值,如快照中所示

我写了这个模块,但是很长

Sub AllChecked()

    If Range("d3").Value = 18 Then
        MsgBox "Project ready for upload"
    End If
    If Range("c3").Value = False Then
        MsgBox "Please review the cover sheet"
    End If
    If Range("c4").Value = False Then
        MsgBox "Please review the processor's notes"
    End If
    If Range("c5").Value = False Then
        MsgBox "Please Review the project map"
    End If
    If Range("c6").Value = False Then
        MsgBox "Please Check the orientation"
    End If
    If Range("c7").Value = False Then
        MsgBox "Please Check for missing data"
    End If
    If Range("c8").Value = False Then
        MsgBox "Please Check for illegal movements"
    End If
    If Range("c9").Value = False Then
        MsgBox "Analyze the data in 2 to 3-hour increments as well as 15-minute increments"
    End If
    If Range("c10").Value = False Then
        MsgBox "Please check the date of collection"
    End If
    If Range("c11").Value = False Then
        MsgBox "Please Check for abnormal peaks or valleys in the datasets"
    End If
    If Range("c12").Value = False Then
        MsgBox "Please give spot checks if necessary"
    End If
    If Range("c13").Value = False Then
        MsgBox "Make small adjustments if necessary"
    End If
    If Range("c14").Value = False Then
        MsgBox "Please checking historical data if it exists"
    End If
    If Range("c15").Value = False Then
        MsgBox "Please Check for the diffrent templets as per the project series"
    End If
    If Range("c16").Value = False Then
        MsgBox "Please Make note for extra leg (include/exclude)"
    End If
    If Range("c17").Value = False Then
        MsgBox "Before removing the side walk from peds count check the rotation and coversheet if client required or not"
    End If
    If Range("c18").Value = False Then
        MsgBox "Sketches? (Always for the 3000 jobs,some with requested Project)(review the processer sketches)"
    End If
    If Range("c19").Value = False Then
        MsgBox "Check for data patterns in the datasets  for two successive intervals having same total volume and each movement has similarities etc"
    End If
    If Range("c20").Value = False Then
        MsgBox "Check for data patterns in the datasets  for two successive intervals having same total volume and each movement has similarities etc"
    End If

End Sub

您可以在
范围(“C3:C20”)
中循环测试值并生成消息。这样,您将只有一个Msgbox

Sub AllChecked()

    Dim msg As String
    Dim c As Range
    If Range("d3").Value = 18 Then
        MsgBox "Project ready for upload"

    Else
        For Each c In Range("C3:C20")
            If c.Value = FASLE Then msg = msg & c.Offset(0, -1).Value & vbCrLf
        Next
        MsgBox msg, vbInformation, "Fill in these fields before continuing"
    End If


End Sub

显示消息where/when?如果您发布您试图使其工作的代码,我们可以为您提供更多帮助。否则就很模糊了。你想在何时何地显示信息?(例如,是否要使用msbox?要将什么事件用作显示消息的触发器?等等)在所示示例中,所有复选框都未选中。您希望为每个邮件发送消息,还是仅为最后一个邮件发送消息?如果选中了胡萝卜,但橙色未选中,是否希望显示一条消息,说明橙色未选中?如果两个未选中,则在messagebox中依次显示该消息。在msgbox未选中时逐个显示所有相邻单元格的值。非常感谢Thomas Inzina。