Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Msgbox not ok

The following codesnipped throws me out of the procedure if the
cellvalue is found between 2 and -2. I would like to have the
opportunity that the messagebox gives me the option to continue (yes
or no). It also sometimes occure that the cellvalue = #DIV0!. if that
is the case I would like to have the same option (or for any other
error value).

'Check whether all checks are 0
Application.Goto Reference:="Total_Check"
If ActiveCell.Value < -2 Or ActiveCell.Value 2 Then
'Checks not zero - Error message and stop process
MsgBox ("Not all validations are 0, pls review sheet
Checks. Process will be stopped.")
Exit Sub
End If


I came with something like this, but it is not working properly. Excel
is going bezerk and trows me out of the system (referenced memory!!!!)

'Check whether all checks are 0
Application.Goto Reference:="Total_Check"
If ActiveCell.Value < -2 Or ActiveCell.Value 2 Or
ActiveCell.Value = "#DIV0!" Then
warn = "Not all validations are 0, pls review sheet
Checks. End process?"
Ans = MsgBox(warn, vbYesNo)
If Ans = vbYes Then
Exit Sub
End If
End If

Any idea's are very welcome.

Thankx

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Msgbox not ok


If ActiveCell.Value < -2 Or ActiveCell.Value 2 Then
'Checks not zero - Error message and stop process
If MsgBox("Not all validations are 0, please review sheet Checks. " & vbCr & _
"Continue ?", vbYesNo, "Look at Me") = vbNo Then Exit Sub
End If
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"A. Karatas"
wrote in message
The following codesnipped throws me out of the procedure if the
cellvalue is found between 2 and -2. I would like to have the
opportunity that the messagebox gives me the option to continue (yes
or no). It also sometimes occure that the cellvalue = #DIV0!. if that
is the case I would like to have the same option (or for any other
error value).

'Check whether all checks are 0
Application.Goto Reference:="Total_Check"
If ActiveCell.Value < -2 Or ActiveCell.Value 2 Then
'Checks not zero - Error message and stop process
MsgBox ("Not all validations are 0, pls review sheet
Checks. Process will be stopped.")
Exit Sub
End If


I came with something like this, but it is not working properly. Excel
is going bezerk and trows me out of the system (referenced memory!!!!)
'Check whether all checks are 0
Application.Goto Reference:="Total_Check"
If ActiveCell.Value < -2 Or ActiveCell.Value 2 Or
ActiveCell.Value = "#DIV0!" Then
warn = "Not all validations are 0, pls review sheet
Checks. End process?"
Ans = MsgBox(warn, vbYesNo)
If Ans = vbYes Then
Exit Sub
End If
End If
Any idea's are very welcome.
Thankx

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Msgbox not ok

Maybe...

'Check whether all checks are 0
dim ans as long
dim FoundErr as boolean
dim warn as string

Application.Goto Reference:="Total_Check"

founderr = false
if iserror(activecell.value) then
founderr = true
elseif ActiveCell.Value < -2 _
Or ActiveCell.Value 2 Then
founderr = true
end if

if founderr then
warn = "Not all validations are 0, pls review sheet Checks. End process?"
Ans = MsgBox(warn, vbYesNo)
If Ans = vbYes Then
Exit Sub
End If
End If



"A. Karatas" wrote:

The following codesnipped throws me out of the procedure if the
cellvalue is found between 2 and -2. I would like to have the
opportunity that the messagebox gives me the option to continue (yes
or no). It also sometimes occure that the cellvalue = #DIV0!. if that
is the case I would like to have the same option (or for any other
error value).

'Check whether all checks are 0
Application.Goto Reference:="Total_Check"
If ActiveCell.Value < -2 Or ActiveCell.Value 2 Then
'Checks not zero - Error message and stop process
MsgBox ("Not all validations are 0, pls review sheet
Checks. Process will be stopped.")
Exit Sub
End If

I came with something like this, but it is not working properly. Excel
is going bezerk and trows me out of the system (referenced memory!!!!)

'Check whether all checks are 0
Application.Goto Reference:="Total_Check"
If ActiveCell.Value < -2 Or ActiveCell.Value 2 Or
ActiveCell.Value = "#DIV0!" Then
warn = "Not all validations are 0, pls review sheet
Checks. End process?"
Ans = MsgBox(warn, vbYesNo)
If Ans = vbYes Then
Exit Sub
End If
End If

Any idea's are very welcome.

Thankx


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Msgbox not ok

Thankx, It is working.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Msgbox not ok

Thankx guys. Both are working!!

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
MsgBox bumper338 Excel Discussion (Misc queries) 1 December 22nd 06 11:32 PM
MsgBox shasta[_5_] Excel Programming 4 April 13th 04 01:56 PM
MsgBox help Aaron Cooper Excel Programming 3 April 12th 04 08:19 PM
Msgbox Lawson Excel Programming 3 April 6th 04 12:15 AM
help with msgbox shirley Excel Programming 3 February 10th 04 04:58 AM


All times are GMT +1. The time now is 06:00 PM.

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"