Command Button Prompt
Bob,
I linked all the relevant cells to a range, however, when I type the
following code:
Sub sendwarning()
If Application.CountIf(Range("CJ1:CJ143", 0)) =
Range("CJ1:CJ143").Cells.Count Then
If MsgBox("No Pivot Detected. Proceed Anyways?", vbOKCancel) = vbOK
Then
Call OtherMacros
End If
End If
End Sub
an error pops up saying "Sub or function not defined" which is referring to
the Call OtherMacros section. Any ideas? Also, I want the button to run my
other macro if the OK button is pushed OR if any of the cells in my range do
not equal zero. How can I modify to incorporate this?
Thanks
Adam Bush
"Bob Phillips" wrote:
Sub myMacro
If Application.CountIf(Range("A1:A100",0)) =Range("A1:A100").Cells.Count
Then
If MsgBox("Are you sure that you want to proceed?",vbOKCancel)
=vbOK Then
Call OtherMacros
End If
End If
End SUb
--
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"
m wrote in message
...
I have a command button on one of my worksheets and I want to add a
conditional function to it. There are over a hundred cells in my
worksheet
that if they all equal zero and you push the button a dialogue box would
appear with the message "Are you sure you want to proceed?" It would have
two options, OK, or cancel, in which the attached macro would only run if
the
OK button was pushed. Is this possible? Any help would be greatly
appreciated.
Thanks
Adam Bush
|