Results 1 to 3 of 3

How to stop the for loop?

Threaded View

ccs1981 How to stop the for loop? 09-25-2008, 06:48 AM
MatrixMan Hi - although I don't follow... 09-25-2008, 06:54 AM
royUK Use Exit For Put it... 09-25-2008, 07:33 AM
  1. #1
    Registered User
    Join Date
    09-16-2008
    Location
    malaysia
    Posts
    89

    How to stop the for loop?

    hi all, i am facing another problem here.

    i want to stop a for loop.

    i attach my excile file at here.
    it is call as parent if the column "a" is blank n hv alphabet.
    if the column "a" is not blank n hv numberic it is call as child.
    i want to delete the child if the parent come out a word "mount"


    here are my code

    
    Sub aa()
      
     r = ActiveSheet.UsedRange.Rows.Count
     For i = 1 To r - 1
        If InStr(3, Cells(i, 3).Value, "MOUNT") > 0 Then
        z = i + 1
     
        For z = 1 To r - 1
          If Cells(z, "a").Value <> "" Then
          Rows(z).Select
          Selection.Delete Shift:=xlUp
           'ElseIf Cells(z, "a").Value = "" Then
           'stop this for loop and go to find another parent whether hv mount -- this part how to write --
        End If
        
          Next
          
        End If
      Next i
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Use Event Procedure and OnTime to Stop a Macro
    By Protiusmime in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-26-2008, 07:46 PM
  2. Stop a running macro
    By Frank e in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-18-2008, 02:07 PM
  3. how to stop pivotTable?
    By Mohsin in forum Excel General
    Replies: 0
    Last Post: 04-25-2007, 04:37 AM
  4. Stop all macro's
    By RickBartels in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-08-2007, 06:55 AM
  5. Stop relation between two sheets
    By Dipwind in forum Excel General
    Replies: 5
    Last Post: 12-08-2006, 02:27 AM

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