Results 1 to 4 of 4

With Loop + Find Method = Confused

Threaded View

  1. #1
    Registered User
    Join Date
    02-23-2010
    Location
    USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    2

    Arrow With Loop + Find Method = Confused

    Greetings!

    A couple years ago I got my feet wet with VBA in Excel 2003, and had a good time of it. I'm a big fan of With and Find, we used to get along well. However, I've since upgraded to 2007, and am having trouble recollecting my former know-how to get even simple macros built again.

    The current problem is this: I have a very large worksheet (row count maxed in 2007, and then some), for which I need to do the following: search column A for a string that will occur many times, and then check the 10 cells that follow in its row for negative values, dropping some sort of indicator in the 11th (shading it red or something would be fine). An additional bonus would be if the 10 cells that possibly contain a negative could be summed (the sum could serve as the indicator?). If no negative is found, nothing need be done, and the macro should chug along searching A for the next reference to this string.

    My hope was to do a sort of "With Range("A:A"), .Find("MyString")", save position as StartPos, do the 10-cell row checking in a nested IF or For (though the For would take a long while, checking each cell individually), then doing a .FindNext after StartPos until = StartPos (does .FindNext loop back to the top?). The formatting of the indicator cell in the 12th cell in each relevant row doesn't really matter, it's more just for jumping to critical rows.

    Is any of this possible? Efficiency would be nice, as I could absolutely code a For loop to run through the million-plus rows, but I expect about 130,000 hits on MyString in column A, so it would take quite a while.

    Thanks in advance for any help offered!
    Last edited by hurricanopotamus; 02-23-2010 at 02:11 PM. Reason: Solved the problem!

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