A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Cell Required before Closing



 
 
Thread Tools Display Modes
  #1  
Old April 11th 12, 07:15 PM
Jenn T Jenn T is offline
Junior Member
 
First recorded activity by ExcelBanter: Apr 2012
Posts: 2
Default Cell Required before Closing

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?
Ads
  #2  
Old April 11th 12, 10:05 PM posted to microsoft.public.excel.programming
Auric__
external usenet poster
 
Posts: 303
Default Cell Required before Closing

Jenn T wrote:

> 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

--
When you grow up, your heart dies.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Force required entry in cell before leaving that cell Retired Bill Excel Worksheet Functions 8 March 17th 09 10:57 PM
How to make a cell required if another cell has text in it Jonine New Users to Excel 3 June 19th 07 06:05 PM
How do I work on data starting to a cell a cell with a required va Tom London Excel Programming 6 October 22nd 06 04:46 PM
Cell function required mickbarry Excel Worksheet Functions 6 February 7th 06 11:34 PM
Setting a required cell igor Excel Programming 0 August 20th 03 05:40 PM


All times are GMT +1. The time now is 04:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2004-2013 ExcelBanter.
The comments are property of their posters.