+ Reply to Thread
Results 1 to 12 of 12

how to avoid infinite loops ine excel vba ?

Hybrid View

  1. #1
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: how to avoid infinite loops ine excel vba ?

    You've used Quote Tags not Code Tags

    Please edit them & check this

    Option Explicit
    
    Sub IbanNo()
        Dim LR As Long
        Dim iX As Long
        Dim rRng As Range
        LR = ActiveSheet.UsedRange.Rows.Count
    
        For iX = 4 To LR
    
            If Not IsEmpty(Cells(iX, 16)) And Left(Cells(iX, 16), 4) <> "PT50" Then
                If rRng Is Nothing Then
                    Set rRng = Cells(iX, 16)
                Else: Set rRng = Union(rRng, Cells(iX, 16))
                End If
            End If
        Next iX
        With rRng
            .Interior.ColorIndex = 3
        End With
    End Sub
    Last edited by royUK; 10-25-2011 at 03:56 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  2. #2
    Registered User
    Join Date
    10-25-2011
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to avoid infinite loops ine excel vba ?

    thanks a loooot RoyUk helped me a lot.this thread is solved but i dunno how to mark it .help this newbie out .

+ 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