+ Reply to Thread
Results 1 to 7 of 7

A quicker way to use a loop

Hybrid View

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: A quicker way to use a loop

    Thanks cytop. Good tip.

    This still loops row by row. What i was wondering is I have 30,000+ rows and maybe only 1,000 have NOT AVAILABLE. Is there a more efficient way to do so, maybe not?

  2. #2
    Forum Contributor gsnidow's Avatar
    Join Date
    07-22-2010
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    150

    Re: A quicker way to use a loop

    bkeat, you could try a For each loop on a range. I'm not going to say one way or the other if it is faster than what you have, but there are definitely situations where either one may come out the winner. If you really don't want to iterate through every row, you could do something like have your code filter for values, then update those cells, but, behind the scenes, the compiler is going to have to loop through each row anyway to apply a filter.
    Set Rng = Range("Y2:Y" & LastRow)
    
    For Each c In Rng
        If c.Value = "Not Available" Then
                c.FormulaR1C1 = "FORMULA"
        End If
    Next c
    Greg

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Quicker way to loop through WorksheetFunction?
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-07-2013, 05:11 AM
  2. Can the following Vba's be improved to run quicker.
    By Toonies in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-11-2012, 06:54 AM
  3. Is there a quicker way to do this
    By jonn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2008, 11:12 AM
  4. Quicker way?
    By Craiig in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-22-2008, 07:32 AM
  5. Quicker VBA
    By sparx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-10-2007, 06:47 AM

Tags for this Thread

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