+ Reply to Thread
Results 1 to 6 of 6

doing a loop repeatedly only for an specific value

  1. #1
    Registered User
    Join Date
    02-24-2009
    Location
    Tehran
    MS-Off Ver
    Excel 2010
    Posts
    45

    Exclamation doing a loop repeatedly only for an specific value

    Hi,

    I have 4 Columns which have these values:

    Column A : a, b, c, d, e
    Column B : 100, 200, 300, 400, 500
    Column C : 150, 250, 350, 450, 550
    Column D : (Get random numbers by macro)

    And this a macro which generate random numbers for Column D and check if generated random number there is between ranges of Column B and C then macro returns correspond value from Column A and write it in Column F and if the generated number there is not into any range, it returns "NA" string value .
    Please Login or Register  to view this content.
    Now I need a double check for those cells in Column F which have "NA" value and generate new random numbers only for those cells and do comparison till all cells get a value in range and finally no cell will be remained with "NA" value.
    How can I do double check till get results in range for all cells in Column F?
    Last edited by omid020; 10-28-2013 at 06:32 AM.

  2. #2
    Registered User
    Join Date
    02-24-2009
    Location
    Tehran
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: doing a loop repeatedly only for an specific value

    Did I use suitable procedure for initial concepts?

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: doing a loop repeatedly only for an specific value

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-24-2009
    Location
    Tehran
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: doing a loop repeatedly only for an specific value

    Nice change Thank you yudlugar!
    It works like a charm but I have another question now! let`s assume there is a variable (n) with a given value for example 1000 to produce 1000 random numbers . So I change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    .
    How should I change Loop Until command to do CountIf from F1 to Fn ?

    Thanks

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: doing a loop repeatedly only for an specific value

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-24-2009
    Location
    Tehran
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: doing a loop repeatedly only for an specific value

    Quote Originally Posted by yudlugar View Post
    Please Login or Register  to view this content.
    Thank you!

+ 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. Loop for adding specific worksheets in specific workbooks
    By pankaj8219 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-13-2013, 10:22 AM
  2. Pull Specific Cells from Multiple Worksheets into One, Repeatedly
    By BlackZao in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2012, 09:52 AM
  3. use for loop instead of specific cell
    By suny100 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-14-2011, 06:29 PM
  4. How to loop through specific worksheets?
    By svenk in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-11-2010, 12:15 PM
  5. [SOLVED] Exclude specific wks in FOR EACH wks Loop
    By Dean in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-14-2005, 02:25 PM

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