I am creating a file that requires user-input. If the user begins to fill out the form, I want excel to display an error if they do not finish.
So if I need user input in cells A1, B1, C1, and D1, but the user only fills out A1,B1, and C1, I want excel to display a message saying "All Cells Must be filled. Please fill out cell D1".
This is what I've got so far
The problem with this is that it will only display the message box if the sub is ran. I would like excel to automatically display this text. Also, is there a more efficient way to write that without so many And-Statements?
Thanks
So if I need user input in cells A1, B1, C1, and D1, but the user only fills out A1,B1, and C1, I want excel to display a message saying "All Cells Must be filled. Please fill out cell D1".
This is what I've got so far
Code:
If IsEmpty(Range("A1").Value) = False And IsEmpty(Range("B1").Value) = False And IsEmpty(Range("C1").Value) = False And IsEmpty(Range("D1").Value) = True Then
MsgBox "All Cells Must be filled. Please fill out cell D1"
End if
End sub
The problem with this is that it will only display the message box if the sub is ran. I would like excel to automatically display this text. Also, is there a more efficient way to write that without so many And-Statements?
Thanks