消息框在修复包含错误的单元格时保持显示

请问你能帮帮我吗?

我想作出validation调查的消息框。

消息框中包含消息,因为填充错误。

我想我的消息框不断显示,所以我可以单击包含填充错误的工作表,而不closures消息框。

所以,消息框会引导我修复那张表中的错误

这是我以前的代码:

Private Sub CommandButton1_Click() Dim error As String error = “” If (vehicle = True) And (gasoline_month = 0) Then error = error & “- the expenditure of gasoline should not be empty” & Chr(10) End If If error = “” Then msgbox “clean”, vbInformation Else MsgBox error, vbCritical End Sub 

谢谢,我希望任何人都可以帮助我,(抱歉我的英文不好)

您好,这是不可能与VBA的msgbox,你必须使用userform来实现这一点。

根据需要添加用户表单并放置button,然后尝试。

如果你卡在某个地方,请告诉我们。