Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default msg box to stop user if range is "" (tricky one)

hey...

fyi...

at the moment i got 2 sheets that has a row (B23:T23) where the user needs
to enter closing stock. (a couple of colums are blank(future use)Sheet2
O:T). in the workbook i got a couple modules. one of them Clear the cells
that need to be cleard and then cary the closing stock over to the column for
the next days opening(B5:T5).

what i need is a code that i can put at the start of my existing code that
will check
if range b5 = something (product name/" ") then if b23 = "" msgbox "unable
to clear".
if range c5 = something (product name/" ") then if c23 = "" msgbox "unable
to clear".
if range d5 = somthing (product name/" ") then if d23 = "" msgbox "unabale
to clear".
etc

in a nutshell the user should not be able to print and clear the workbook
if a column got a product name(B5:T5) with a blank closing(B23:T23).
(and told in a msg box all the products names with a blank closing)


--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default msg box to stop user if range is "" (tricky one)

On Mar 25, 1:33*pm, pswanie wrote:
hey...

fyi...

at the moment i got 2 sheets that has a row (B23:T23) where the user needs
to enter closing stock. *(a couple of colums are blank(future use)Sheet2
O:T). *in the workbook i got a couple modules. one of them Clear the cells
that need to be cleard and then cary the closing stock over to the column for
the next days opening(B5:T5).

what i need is a code that i can put at the start of my existing code that
will check
if range b5 = something (product name/" ") then if b23 = "" msgbox "unable
to clear".
if range c5 = something (product name/" ") then if c23 = "" msgbox "unable
to clear".
if range d5 = somthing (product name/" ") then if d23 = "" msgbox "unabale
to clear".
etc

in a nutshell the user should not be able *to print and clear the workbook
if a column got a product name(B5:T5) with a blank closing(B23:T23).
(and told in a msg box all the products names with a blank closing)

--
Helpful advice on posting to newsgroups here...http://www.cpearson.com/excel/newposte.htm


Try this:

If Cells(5,2) < "" Then
If Cells(23,2) = "" Then
Call Msgbox "unable to clear"
End If
End If

etc.

HopeThatHelps

Chris
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default msg box to stop user if range is "" (tricky one)



will i need to repeat this for every column?
or is there a loop idea that i can do?
where would i tell it to first do sheet1 and then sheet2


Try this:

If Cells(5,2) < "" Then
If Cells(23,2) = "" Then
Call Msgbox "unable to clear"
End If
End If


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default msg box to stop user if range is "" (tricky one)

Loop the columns

For ColNum To 2 To 20

If Cells(5,ColNum) < "" Then
If Cells(23,ColNum) = "" Then
Call Msgbox "unable to clear"
End If
End If
Next ColNum

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"pswanie" wrote in message
...


will i need to repeat this for every column?
or is there a loop idea that i can do?
where would i tell it to first do sheet1 and then sheet2


Try this:

If Cells(5,2) < "" Then
If Cells(23,2) = "" Then
Call Msgbox "unable to clear"
End If
End If




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default msg box to stop user if range is "" (tricky one)

i get the

Call Msgbox "unable to clear" in red aswell...


Also a typo. Use either this....

Call MsgBox("unable to clear")

or this...

MsgBox "unable to clear"

Rick
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I stop "global" hyperlinks changing to "local" links? Em Excel Worksheet Functions 2 August 26th 08 01:18 PM
"Tricky Situation" - Validation Formula Teddy-B Excel Discussion (Misc queries) 4 November 24th 07 07:43 PM
Stop users from accessing "Protection" option from "Tools" menu I Believe Excel Programming 2 December 19th 05 02:44 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM
Using "Cells" to write "Range("A:A,H:H").Select" Trip Ives[_2_] Excel Programming 3 June 5th 04 03:13 PM


All times are GMT +1. The time now is 08:42 PM.

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

About Us

"It's about Microsoft Excel"