Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Try This ...
If Range("A1").FormulaR1C1 < 0 Then 'run your code here ActiveWindow.SelectedSheets.PrintPreview Else MsgBox ("Cell [A1] cannot equal Zero") End If regards, Nick "Neil Jimack" wrote: I have a macro assigned to a button, but it can only run if a particular cell is zero. If the cell is greater than or less than zero, I want a message box to appear telling the user that the cell in question isn't zero. I know the code for making the Msgbox appear, but don't know the syntax for only having the box appear if the cell in question isn't zero. Any advice? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF Statement | New Users to Excel | |||
Msgbox | Excel Worksheet Functions | |||
Can I select a worksheet based upon a cell criteria?(for printing) | Excel Worksheet Functions | |||
IF statement based on data type | Excel Worksheet Functions | |||
Conditional formatting based on if statement. | Excel Worksheet Functions |