PC Review


Reply
Thread Tools Rate Thread

Cells Left Blank

 
 
=?Utf-8?B?RXJpYw==?=
Guest
Posts: n/a
 
      10th Oct 2007
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

 
Reply With Quote
 
 
 
 
JW
Guest
Posts: n/a
 
      10th Oct 2007
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


 
Reply With Quote
 
=?Utf-8?B?RXJpYw==?=
Guest
Posts: n/a
 
      10th Oct 2007
JW,

Thank you this works but it says that cell b9 is empty and this is good now
let me through a twist into things.

What if I lable this cell would I just switch B9 for the cell name "Mix
Type". Also, when I hit okay after the msgbox tells me it's empty, it still
goes on to the next page even if the cell is blank.

Sounds like a miner fix.....

"JW" wrote:

> 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

>
>

 
Reply With Quote
 
JW
Guest
Posts: n/a
 
      10th Oct 2007
I need to see the rest of your code structure in order to tell you why
it isn't exiting the code? As for the range names, yes, just replace
the B9 with the name for that range.
Eric wrote:
> JW,
>
> Thank you this works but it says that cell b9 is empty and this is good now
> let me through a twist into things.
>
> What if I lable this cell would I just switch B9 for the cell name "Mix
> Type". Also, when I hit okay after the msgbox tells me it's empty, it still
> goes on to the next page even if the cell is blank.
>
> Sounds like a miner fix.....
>
> "JW" wrote:
>
> > 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

> >
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maximum Number of Blank Cells between Non Blank Cells in a Range Mal Microsoft Excel Worksheet Functions 5 3rd Nov 2007 08:21 AM
Start Cell B1 then find first blank cell, insert subtotal, next non blank, then next blank, sutotal cells in between......... amorrison2006@googlemail.com Microsoft Excel Programming 2 7th Jun 2007 09:27 PM
Display error msg when cells left blank =?Utf-8?B?SmFz?= Microsoft Excel Programming 5 16th May 2007 07:50 PM
Delete cells with text, and shift cells left? Ryk Microsoft Excel Discussion 1 10th Nov 2006 06:40 AM
Validating cells left blank chris100 Microsoft Excel Programming 4 4th Dec 2005 05:39 PM


Features
 

Advertising
 

Newsgroups
 


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