+ Reply to Thread
Results 1 to 3 of 3

newbie question with continuous loop

  1. #1
    Registered User
    Join Date
    11-20-2013
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    2

    newbie question with continuous loop

    =IF((OR(C8="v",C8="vu")),B8,0)+IF((OR(F8="v",F8="vu")),E8,0)+IF((OR(I8="v",I8="vu")),H8,0)

    how to put that in vba.

    example: smaller vrsion
    a b
    1 8 v
    2 8 v
    3 8 s
    4 8 s
    5 8 v
    6 8 s
    7 8 v
    8 32

    in this case there is four's v, i want to display total 32 on cell a8.
    so i guess i need to use the .find and .findnext to loop through column b to find "v", but i dont know how to continuouslly loop through without rerun the marco again.

  2. #2
    Registered User
    Join Date
    11-20-2013
    Location
    Minas Gerais, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: newbie question with continuous loop

    Hello Newbiewexcel,

    I donīt know if I understand correctly but... why do not you use the formula "SUMIF" or "SUMIFS?

    Ex:
    =SUMIF(B1:B7,"v",A1:A7) = 32

    Hugs.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,959

    Re: newbie question with continuous loop

    Hi and welcome to the forum

    why not just use a sumif()?

    =SUMIF($B$1:$B$7,"v",$A$1:$A$7)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Replies: 2
    Last Post: 10-18-2013, 01:56 PM
  2. Need to run continuous loop
    By hockeyadc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-03-2012, 02:03 PM
  3. Creating a Macro / GUI that is continuous and does not loop
    By C Dev in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-26-2012, 04:45 AM
  4. Loop through non-continuous named range in vba
    By awan0126 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-26-2011, 02:56 PM
  5. Continuous loop using a UserForm
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2011, 08:10 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