+ Reply to Thread
Results 1 to 3 of 3

stopping at text....

  1. #1
    Registered User
    Join Date
    10-03-2005
    Posts
    8

    stopping at text....

    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 a certain string of text. Problem is it will be in larger string.

    example: in the below example I find the load case (say load1) but load1 is in a larger string.

    this is load1
    401
    405
    410
    417
    418
    this is load2
    404
    407
    413
    415
    418
    419

    thanks for your help.
    Last edited by nelg; 12-21-2005 at 11:48 PM.

  2. #2
    Jim Cone
    Guest

    Re: stopping at text....

    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. #3
    Registered User
    Join Date
    10-03-2005
    Posts
    8
    Thanks Jim that worked great now onto the second problem. See the same thread for the change.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1