Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
aking1987
 
Posts: n/a
Default Problem with array and msgbox


Code:
--------------------

Sub errorsandproblems()

For i = 14 To 156
If Worksheets("user editable sheet 1").Range("e" & i) = "<ERROR" Then
MsgBox "It appears that you are dumb, go back and fix it"
Else
End If
Next
End Sub
--------------------


If this statement comes across multiple errors between cells 14 to 156
column e, then ONLY one msgbox is to be displayed.

How can i do this?

Antonio


--
aking1987
------------------------------------------------------------------------
aking1987's Profile: http://www.excelforum.com/member.php...o&userid=15393
View this thread: http://www.excelforum.com/showthread...hreadid=273309

  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Antonio,

Sub FixedProblem()
If Application.WorksheetFunction.CountIf(Range("E14:E 156"), "<ERROR") 1
Then
MsgBox "It appears that you are dumb, go back and fix it"
End If
End Sub

HTH,
Bernie
MS Excel MVP

"aking1987" wrote in message
...

Code:
--------------------

Sub errorsandproblems()

For i = 14 To 156
If Worksheets("user editable sheet 1").Range("e" & i) = "<ERROR" Then
MsgBox "It appears that you are dumb, go back and fix it"
Else
End If
Next
End Sub
--------------------


If this statement comes across multiple errors between cells 14 to 156
column e, then ONLY one msgbox is to be displayed.

How can i do this?

Antonio


--
aking1987
------------------------------------------------------------------------
aking1987's Profile:

http://www.excelforum.com/member.php...o&userid=15393
View this thread: http://www.excelforum.com/showthread...hreadid=273309



  #3   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

arrrrrggh, crappy line wrap. The "Then" should be at the end of the long
line....

Sorry

Bernie
MS Excel MVP

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Antonio,

Sub FixedProblem()
If Application.WorksheetFunction.CountIf(Range("E14:E 156"), "<ERROR") 1
Then
MsgBox "It appears that you are dumb, go back and fix it"
End If
End Sub

HTH,
Bernie
MS Excel MVP

"aking1987" wrote in message
...

Code:
--------------------

Sub errorsandproblems()

For i = 14 To 156
If Worksheets("user editable sheet 1").Range("e" & i) = "<ERROR" Then
MsgBox "It appears that you are dumb, go back and fix it"
Else
End If
Next
End Sub
--------------------


If this statement comes across multiple errors between cells 14 to 156
column e, then ONLY one msgbox is to be displayed.

How can i do this?

Antonio


--
aking1987
------------------------------------------------------------------------
aking1987's Profile:

http://www.excelforum.com/member.php...o&userid=15393
View this thread:

http://www.excelforum.com/showthread...hreadid=273309





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
A few VBA questions - long post! Fiona O'Grady Excel Discussion (Misc queries) 5 December 19th 04 05:12 PM


All times are GMT +1. The time now is 01:39 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"