Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() G'day guys, I know there is a simple answer to this. I am searching a column of values and want to stop when I hit text. Is there any way to write a simple if statement that says "If next cell does not equal an integer, exit sub"? example: in the below example I find the load case (say load1) then search under it for node 404. As 404 is not there I need it to stop at load2 and not continue to the 404 value. load1 401 405 410 417 418 load2 404 407 413 415 418 419 thanks for your help. -- nelg ------------------------------------------------------------------------ nelg's Profile: http://www.excelforum.com/member.php...o&userid=27771 View this thread: http://www.excelforum.com/showthread...hreadid=495408 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
n,
'--------------------- Sub StopAtText() Dim rngList As Excel.Range Dim rngCell As Excel.Range Set rngList = Range("B5:B10") For Each rngCell In rngList If Not IsNumeric(rngCell) Then Exit For ' or ' If Val(rngCell) = 0 Then Exit For ' or ' If Not Left(rngCell, 1) Like "#" Then Exit For Next End Sub '----------------------- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "nelg" wrote in message G'day guys, I know there is a simple answer to this. I am searching a column of values and want to stop when I hit text. Is there any way to write a simple if statement that says "If next cell does not equal an integer, exit sub"? example: in the below example I find the load case (say load1) then search under it for node 404. As 404 is not there I need it to stop at load2 and not continue to the 404 value. load1 401 405 410 417 418 load2 404 407 413 415 418 419 thanks for your help. nelg |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Jim that worked great now onto the second problem. See the sam thread for the change -- nel ----------------------------------------------------------------------- nelg's Profile: http://www.excelforum.com/member.php...fo&userid=2777 View this thread: http://www.excelforum.com/showthread.php?threadid=49540 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Stopping hyperlink text | Excel Discussion (Misc queries) | |||
Stopping free text entry in validation cell | Excel Discussion (Misc queries) | |||
Stopping a Macro | Excel Programming | |||
stopping pasted text deliminate across multiple cells | Excel Discussion (Misc queries) | |||
Stopping Excel from converting copied text data! | Excel Programming |