Posts by RRM1

    Solved. I took your code and re-modified it to value paste the series of data into sheet 2, as a sequence once the condition is met. This gives me the desired outcome. Thanks again for your guidance.


    Thanks for the feedback. I tried to manipulate your code to generate the range of numbers in sheet 2 only as a sequence as how they were displayed in sheet 1, once the condition is met but, I failed.


    What I want to achieve is to copy the range of numbers in each column starting from sheet 1, column N5:N7 then paste it into column C, C5:C7. Once the condition is TRUE looking at sheet 1, A1 then this range of numbers are value pasted into sheet 2, A1:A3. The iteration starts over again and moves to the next column in sheet 1, that is O5:O7 and does the same thing by pasting in C5:C7 this range of numbers and once the condition is met then it value paste that range into sheet 2, B1:B3 etc. This continues for each column of data until a blank column is met in sheet 1. The code ends then.


    I failed to modify your code. I want to achieve pasting each separate column range of numbers in sheet 2 only as a sequence to each other and and also to ensure the condition set is a reflection of each range of numbers pasted into sheet 1, C11. Hope this is clearer or at least let me know. Thanks in advance. My failed attempt at code below :-(

    Hi, this is a request for a new sub routine. I've attached a template for the steps and dummy data that I would like to simulate.


    I have multiple columns of random data (3 rows each) from columns N to column T or at least until there is an empty column range in sheet1. I want to copy and paste the first column data ( 3 rows) in column N and paste it to say sheet 1, cell C5 then my model runs until a condition is met and paste results in the next sheet2. Once that condition is met, then I want to get next column data (3 rows) from column N and paste over the data in cell C5 and the model runs until same condition is met again etc. This goes on until a blank column is met in sheet1 then stops.


    Thanks in advance.

    Hi, could I ask for further assistance with code? I am not sure if this is a new thread but it is meant to appendix the above code in my model.


    This will be a new sub routine.


    I have multiple columns of data (3 rows each) from columns M to column U or at least until there is an empty column range in sheet1. I want to copy and paste the first column data ( 3 rows) in column N and paste it to say sheet 1, cell C5 then my model runs until a condition is met and paste results in the next sheet2. Once that condition is met, then I want to get next column data (3 rows) from column N and paste over the data in cell C5 and the model runs until same condition is met again etc. This goes on until a blank column data is met in sheet1 then stops.


    If this is in violation of the forum rules please let me know, I'll understand. Thanks in advance.

    Good day,

    I have code that looks at the values generated from a random generator and once a condition is met then it stops. For example, it counts the numbers generated (for example 1, 2, 3) in range P1:P3 and once the condition value set in sheet1, A1 is met > 2, then it stops.


    I would like to go further by running more iterations. That is once condition is met in sheet 1, A1 then it copy and paste values sheet 1, P1:P3 into sheet2, A1:A3 then goes back to sheet 1 and re-runs the below code. I would like to do this 10 times. Each time condition is met then it copy and paste value into sheet2, in next available column, B1:B3 then C1:C3 until sheet2, J1:J3 is populated with a range then END. Is there a nested DO UNTIL LOOP, IF THEN to use? I have no clue and appreciate guidance.

    Code
    1. Do
    2. Sheet1.Range("A1").Formula = "=COUNTIF($P$1:$P$3,0)"
    3. Loop Until Sheet1.Range("A1").Value > 2
    4. End Sub

    Hi, I have a function that generates a random number range based on a condition so I would like to copy the column range of these numbers (say column B1:B10) and paste it to another column in the same worksheet (say F1:10) once the condition is met and continue to copy the same column range (B1:B10) after the next iteration condition is met and paste into the next blank column (G1:G10) until 10 iterations, that is columns F to O are populated with the data range from column B1:B10. Is there a code I can perform this with? Thanks in advance.