View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Cells Left Blank

To add more cirteria, just add more range addresses to the rangeArray.
Sub howAboutThis()
Dim rangeArray As Variant, r As Range
rangeArray = Array("B9", "B10", "B15")
For i = LBound(rangeArray) To UBound(rangeArray)
If IsEmpty(Range(rangeArray(i))) Then
MsgBox rangeArray(i) & " can not be blank"
Exit Sub
End If
Next i
'rest of your code here
End Sub

Eric wrote:
Hello all,

I am trying to make a macro that won't let you continue unless all the cells
on a particular sheet are filled in with information.

ie:
Before clicking the worksheet macro cells B9, B10, B15, etc. must contain
information. If cells B9 and B10 have info but not B15 the worksheet macro
should stop and give the message box that B15 isn't filled in.

I hope this makes sence to everyone.
Thank you in advance for all the help.

Eric