T
Tonso
I have a macro that, after the user fills in 2 different areas of a
form, the data in those areas are appended to an Excel list. If either
area is not completely filled out, I want a message to appear
indicating where the problem is, and the sub exited. I used the
following code:
If Range("c3") = "" Or Range("c4") = "" Or Range("C5") = "" Or
Range("C6") = "" Or _
Range("C7") = "" Or Range("C8") = "" Then
answer = MsgBox("Incomplete Header Information", vbInformation)
End If
If Range("j10") = "" Or Range("j11") = "" Or Range("j12") = "" Or
Range("J13") = "" Or _
Range("J14") = "" Or Range("J15") = "" Or Range("J16") = "" Or
Range("J17") = "" Or _
Range("J18") = "" Or Range("J19") = "" Or Range("J20") = "" Or
Range("J21") = "" Then
answer = MsgBox("All Questions must be answered Yes/No",
vbInformation)
Else
Application.ScreenUpdating = False
Range("c3:c8").Select
Selection.Copy
etc etc etc
End If
End Sub
If the area C3:C8 is incomplete, and J10:J21 is complete, the 1st
message appears, as it should, but the sub is ran instead of exited.
Otherwise, it works as it should. How do I correct this. I am pretty
certain this is probably not the most efficient way to accomplish
this.
Thanks,
Tonso
form, the data in those areas are appended to an Excel list. If either
area is not completely filled out, I want a message to appear
indicating where the problem is, and the sub exited. I used the
following code:
If Range("c3") = "" Or Range("c4") = "" Or Range("C5") = "" Or
Range("C6") = "" Or _
Range("C7") = "" Or Range("C8") = "" Then
answer = MsgBox("Incomplete Header Information", vbInformation)
End If
If Range("j10") = "" Or Range("j11") = "" Or Range("j12") = "" Or
Range("J13") = "" Or _
Range("J14") = "" Or Range("J15") = "" Or Range("J16") = "" Or
Range("J17") = "" Or _
Range("J18") = "" Or Range("J19") = "" Or Range("J20") = "" Or
Range("J21") = "" Then
answer = MsgBox("All Questions must be answered Yes/No",
vbInformation)
Else
Application.ScreenUpdating = False
Range("c3:c8").Select
Selection.Copy
etc etc etc
End If
End Sub
If the area C3:C8 is incomplete, and J10:J21 is complete, the 1st
message appears, as it should, but the sub is ran instead of exited.
Otherwise, it works as it should. How do I correct this. I am pretty
certain this is probably not the most efficient way to accomplish
this.
Thanks,
Tonso