ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CellValueOfZero (https://www.excelbanter.com/excel-programming/309289-cellvalueofzero.html)

Mike

CellValueOfZero
 
I have a macro that is activated by button. I have a cell b4 that an operator
must
enter a numerical value greater than zero.
I need a sub that would check the value of cell b4. If the value is greater
than zero,
then the sub would proceed.
If cell b4 is equal to 0, then a message box would appear telling the operator
that a 0 value has been entered. Once the operator clicks the OK in the
message
box, an exit sub would be activated and the operator
would be returned to the data entry screen.
thanks for any assistance.

Jorge Rodrigues

CellValueOfZero
 
Hi Mike,

Try this for beggining:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("B4") < 0 Then
Call Test
ElseIf Range("B4") = 0 Then
MsgBox "a 0 value has been entered!"
Else
End If
End Sub


Sub Test()
MsgBox "Bla Bla Bla"
End Sub

Regards.
Jorge
"Mike" escreveu na mensagem
...
I have a macro that is activated by button. I have a cell b4 that an

operator
must
enter a numerical value greater than zero.
I need a sub that would check the value of cell b4. If the value is

greater
than zero,
then the sub would proceed.
If cell b4 is equal to 0, then a message box would appear telling the

operator
that a 0 value has been entered. Once the operator clicks the OK in the
message
box, an exit sub would be activated and the operator
would be returned to the data entry screen.
thanks for any assistance.




Jorge Rodrigues

CellValueOfZero
 
A little bit mo

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If IsEmpty(Range("B4")) Then
Exit Sub
End If

If Range("B4") < 0 Then
Call Test
ElseIf Range("B4") = 0 Then
MsgBox "a 0 value has been entered!"
Else
Exit Sub
End If
End Sub


Sub Test()
MsgBox "Bla Bla Bla"
End Sub


Regards.
Jorge
"Jorge Rodrigues" escreveu na mensagem
...
Hi Mike,

Try this for beggining:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("B4") < 0 Then
Call Test
ElseIf Range("B4") = 0 Then
MsgBox "a 0 value has been entered!"
Else
End If
End Sub


Sub Test()
MsgBox "Bla Bla Bla"
End Sub

Regards.
Jorge
"Mike" escreveu na mensagem
...
I have a macro that is activated by button. I have a cell b4 that an

operator
must
enter a numerical value greater than zero.
I need a sub that would check the value of cell b4. If the value is

greater
than zero,
then the sub would proceed.
If cell b4 is equal to 0, then a message box would appear telling the

operator
that a 0 value has been entered. Once the operator clicks the OK in the
message
box, an exit sub would be activated and the operator
would be returned to the data entry screen.
thanks for any assistance.






Jorge Rodrigues

CellValueOfZero
 
And a little bit mo

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If IsEmpty(Range("B4")) Then
Exit Sub
End If

If Range("B4") < 0 Then
Call Test
ElseIf Range("B4") = 0 Then
MsgBox "a 0 value has been entered!"
Else
Exit Sub
End If
Range("B4").ClearContents
End Sub


Sub Test()
MsgBox "Bla Bla Bla"
End Sub

Regards.
Jorge
"Jorge Rodrigues" escreveu na mensagem
...
Hi Mike,

Try this for beggining:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("B4") < 0 Then
Call Test
ElseIf Range("B4") = 0 Then
MsgBox "a 0 value has been entered!"
Else
End If
End Sub


Sub Test()
MsgBox "Bla Bla Bla"
End Sub

Regards.
Jorge
"Mike" escreveu na mensagem
...
I have a macro that is activated by button. I have a cell b4 that an

operator
must
enter a numerical value greater than zero.
I need a sub that would check the value of cell b4. If the value is

greater
than zero,
then the sub would proceed.
If cell b4 is equal to 0, then a message box would appear telling the

operator
that a 0 value has been entered. Once the operator clicks the OK in the
message
box, an exit sub would be activated and the operator
would be returned to the data entry screen.
thanks for any assistance.






Mike

CellValueOfZero
 
Jorge
Thanks for the help. Appreciate it.
Mike

"Mike" wrote:

I have a macro that is activated by button. I have a cell b4 that an operator
must
enter a numerical value greater than zero.
I need a sub that would check the value of cell b4. If the value is greater
than zero,
then the sub would proceed.
If cell b4 is equal to 0, then a message box would appear telling the operator
that a 0 value has been entered. Once the operator clicks the OK in the
message
box, an exit sub would be activated and the operator
would be returned to the data entry screen.
thanks for any assistance.



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com