Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There isn't a separate msgbox function and and msgbox statement.
Just for clarity There is only a msgbox function. If you choose not to use the returned value, you don't put the arguments in parentheses (unless you preface it with call). This is a VBA syntax rule. All these work. All use the msgbox function Sub AB() MsgBox "First Fill In The Name", vbOKCancel Call MsgBox("First Fill In The Name", vbOKCancel) ans = MsgBox("First Fill In The Name", vbOKCancel) End Sub Just to cover all the bases, this will work MsgBox ("First Fill In the Name") but the parentheses around a single argument are interpreted for a different purpose. They cause the argument to be evaluated - essentially forcing a byVal argument. -- Regards, Tom Ogilvy "moon" <6369706865725F6475646540706C616E65742E6E6C wrote in message . .. A Range or a Cell can not be True or False, only the value that's in there. Print #1 is being used when writing data to a file, for a worksheet you'll need PrintOut. Try it again, but then referencing the cell-address instead of the range. 'Row 4, Column 2 = B4 If ActiveSheet.Cells(4, 2).Value < Empty Then ActiveSheet.PrintOut End If "Rob" schreef in bericht ... It still doesn't work. If ActiveSheet.Range("B40") = False Or "" Then Print #1, End If I don't know... It's got to be something. "moon" wrote: Because the 'value' is always True, even if it's an empty value. So... If Application.ActiveSheet.Range("B40").Value < Empty Then ActiveSheet.PrintOut End If "Rob" schreef in bericht ... Ahhhh sweet. I tried your suggestion but it still prints. "moon" wrote: It means 'almost I guess'. I'm just confusing newsgroups, that's all :-o "Rob" schreef in bericht ... Ummmm... What? "moon" wrote: Bijna... Denk ik. If Application.ActiveSheet.Range("B40").Value = True Then ActiveSheet.PrintOut End If "Rob" schreef in bericht ... I'm wondering if there is a way to disable the ability to print unless cell B40 is < FALSE, Something like this... Sub ThisWorkbook_Print() If Application.ActiveSheet.Range("B40").Value = False Then Application.ActivePrinter = Nothing End If End Sub I was hoping that the above code I made might do it but it doesn't seem to work. Any Ideas? Thanks In Advance, Rob |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I disable the advanced printing features permanently? | Excel Discussion (Misc queries) | |||
How to disable printing a specific worksheet? | Excel Worksheet Functions | |||
How to disable printing a specific worksheet? | Excel Worksheet Functions | |||
Printing gridlines with empty cell | Excel Discussion (Misc queries) | |||
Disable Printing | Excel Discussion (Misc queries) |