Here's a function that you can call in your routines:
Public Function FormComplete(ByVal rngCells As Range) As Boolean
Dim rngCell As Range
FormComplete = True
For Each rngCell In Intersect(rngCells, rngCells.Parent.UsedRange)
If Not rngCell.Locked Then
FormComplete = CBool(Len(rngCell.Value))
If Not FormComplete Then Exit Function
How to use
If FormComplete(Range("A1:B4")) Then
MsgBox "OK - run macro"
MsgBox "Emplty cells, halt!"
No. The first code is a function that takes a range argument. If any cell within that range is unlocked AND empty then the function returns False. If there are no unlocked cells, or if all of the unlocked cells contain something then it returns True.
The second code demonstrates how to use the function. So in this routine you pass the range that you want to evaluate to the FormComplete function. If FormComplete returns False then you instruct it not to run the main code, otherwise allow it to run the main code.