Is there a simple way to check lots of cells for entries?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a worksheet that has rows 3 - 23 in input lines for the user. Not all
rows will be used. It depends on how many places the person has visited.

When the person goes to save the file I want to check to see if certain
columns have been filled in. If they have not then I want to open a message
box telling them to fill them in before saving.

My question is this. since not all rows will have entries I only want to
test the rows that have something in any of the columns A - AF

Is there a simple way to check this?
 
Try this

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
msg = "You must fill in the sheet before saving"
If Worksheets("sheet5").Range("A3:AF23").Text = "" Then
MsgBox (msg)
End If
End Sub
 
Hi Mike,

Unfortunatly this won't work as some fields are required and others are a
case of this option or this option so some cells are mandatory and others are
not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top