Cell Required before Closing

J

Jenn T

I am trying to require that the cells in column G thru J be filled ou
if column C contains a certain value. I have been successful at makin
cell G5 be required if C5 has a value but I can not expand on this. Fo
example:
If C5 = "Proposal" then G5, H5, I5, J5 are required.
If C6 = "Proposal" then G6, H6, I6, J6 are required.
etc all the way to C2006.

This is what I have so far:

If Worksheets("2012").Range("C5").Value = "Proposal" Then
If Worksheets("2012").Range("G5").Value <> "" Then
MsgBox "You must fill in Proposal Data."
Cancel = True

End If

Any thoughts
 
A

Auric__

Jenn said:
I am trying to require that the cells in column G thru J be filled out
if column C contains a certain value. I have been successful at making
cell G5 be required if C5 has a value but I can not expand on this. For
example:
If C5 = "Proposal" then G5, H5, I5, J5 are required.
If C6 = "Proposal" then G6, H6, I6, J6 are required.
etc all the way to C2006.

This is what I have so far:

If Worksheets("2012").Range("C5").Value = "Proposal" Then
If Worksheets("2012").Range("G5").Value <> "" Then
MsgBox "You must fill in Proposal Data."
Cancel = True

End If

Any thoughts?

Try this:

With Worksheets("2012")
For ro = 5 To 6
If .Cells(ro, 3).Value = "Proposal" Then
For co = 7 To 10
If .Cells(ro, co).Value = "" Then
.Cells(ro, co).Activate
MsgBox "You must fill in Proposal Data."
Cancel = True
Exit Sub
End If
Next co
End If
Next ro
End With
 

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

Top