Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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.

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



All times are GMT +1. The time now is 06:19 AM.

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"