+ Reply to Thread
Results 1 to 5 of 5

List generator

  1. #1
    Registered User
    Join Date
    01-10-2019
    Location
    Philippines
    MS-Off Ver
    2007
    Posts
    2

    List generator

    HI!

    Please Help!

    How to create a macro for listing the numbers in A3:I3 in sheet3 if the sum at a certain cell (K5) is equal or greater than 70.
    A3:I3 generates a random number.
    K5 generates a sum based on the combinations of random numbers at A3:I3.
    I want to list 10 sets of numbers at sheet3.So the program generates/lists sets of numbers as long as the condition A2>=70 in sheet 3 up to 10 rows (10 sets)

    FROM
    Screen Shot 2019-01-11 at 2.19.40 AM.png

    TO
    Screen Shot 2019-01-11 at 2.20.04 AM.png
    Last edited by karlmonfort; 01-10-2019 at 03:08 PM.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    2007 Enterprise
    Posts
    4,232

    Re: List generator

    .
    The provided link / URL is bad.

    Please provide better explanation of your goal.

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    2013 / 2016 / 365
    Posts
    6,670

    Re: List generator

    And please attach a sample workbook. Pictures are nice, but nobody is going to go through the trouble of reconstructing a workbook with your data when you already have one.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  4. #4
    Registered User
    Join Date
    01-10-2019
    Location
    Philippines
    MS-Off Ver
    2007
    Posts
    2

    Re: List generator

    Hi! I tried
    making the macro and set the result at A94+

    Please tell me what's wrong in this, it doesnt recalculate

    Sub GenerateRandoms1()
    Const Min As Long = 1
    Const Max As Long = 31
    Dim Ws As Worksheet
    Set Ws = Worksheets("Sheet2")
    Application.ScreenUpdating = False

    For i = Min To Max
    If K5 < 70 Then
    Calculate
    If K5 >= 70 Then
    Range("A3:I3").Select
    Selection.Copy
    Range("A94+i").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    End If
    End If
    Next i
    End Sub

    Thanks in advance and more powers!

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    2013 / 2016 / 365
    Posts
    6,670

    Re: List generator

    Also read the rules and use code tags. I will not be responding to this post until you comply with the rules.

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html

+ Reply to Thread

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