+ Reply to Thread
Results 1 to 8 of 8

HELP - Modifying where solutions are sent/placed!

  1. #1
    Registered User
    Join Date
    02-17-2018
    Location
    United Kingdom
    MS-Off Ver
    2013
    Posts
    20

    Post HELP - Modifying where solutions are sent/placed!

    Hi,

    I have a script for an equation that incrementally increases an input from a specified minimum to maximum, it then places the answers in a list in a column on the same worksheet.

    It produces 5 unique solutions. I wish to modify the script so that it places each solution in the worksheet 3 times.

    Currently the answers list as follows:
    0.0000005
    0.0000055
    0.0000105
    0.0000155
    0.0000205

    However, I require them to be listed as follows:

    0.0000005
    0.0000005
    0.0000005
    0.0000055
    0.0000055
    0.0000055
    0.0000105
    0.0000105
    0.0000105
    0.0000155
    0.0000155
    0.0000155
    0.0000205
    0.0000205
    0.0000205

    How can the following script be modified to do so?

    Please Login or Register  to view this content.
    Thanks,
    HU

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: HELP - Modifying where solutions are sent/placed!

    Attach a sample workbook. 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.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    02-17-2018
    Location
    United Kingdom
    MS-Off Ver
    2013
    Posts
    20

    Re: HELP - Modifying where solutions are sent/placed!

    Please Login or Register  to view this content.

    Apologies, this is the script I meant to originally post.

    Sample before and after worksheets attached. All irrelevant information has been omitted. The 'before' file has been saved as an .xlsm and includes the macro in question. The 'after' worksheet only includes what I wish the macro to produce.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: HELP - Modifying where solutions are sent/placed!

    Try this

    Please Login or Register  to view this content.
    Changes made:
    Array size multiplied by 3
    Please Login or Register  to view this content.
    Loop added to repeat the values 3 times
    Please Login or Register  to view this content.
    Which means that k must increment by 3 each time
    Please Login or Register  to view this content.
    Last edited by kev_; 02-19-2018 at 10:24 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  5. #5
    Registered User
    Join Date
    02-17-2018
    Location
    United Kingdom
    MS-Off Ver
    2013
    Posts
    20

    Re: HELP - Modifying where solutions are sent/placed!

    This solves that particular issue.

    On a related note, how would it be modified further so that the solutions this time were ordered as follows:

    0.0000005
    0.0000055
    0.0000105
    0.0000155
    0.0000205
    0.0000005
    0.0000055
    0.0000105
    0.0000155
    0.0000205
    0.0000005
    0.0000055
    0.0000105
    0.0000155
    0.0000205


    Thanks in advance.

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: HELP - Modifying where solutions are sent/placed!

    My lazy way:

    Go back to the code you supplied in post#3
    replace:
    Please Login or Register  to view this content.
    with:
    Please Login or Register  to view this content.

    An alternative:


    You could instead put all the values in the array, resizing the array as in post#4
    And as you loop, write to these array elements at the same time (with same value)
    answers(i)
    answers(i + dElements)
    answers(i + dElements+ dElements)
    k would increment by 1
    The line writing values to the worksheet would then revert to the original line
    Last edited by kev_; 02-19-2018 at 01:08 PM.

  7. #7
    Registered User
    Join Date
    02-17-2018
    Location
    United Kingdom
    MS-Off Ver
    2013
    Posts
    20

    Re: HELP - Modifying where solutions are sent/placed!

    Thanks again kev!

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: HELP - Modifying where solutions are sent/placed!

    Please mark thread as SOLVED (see ThreadTools at top of thread)
    thanks for rep
    Last edited by kev_; 02-19-2018 at 01:13 PM.

+ 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. Looking for some solutions in my work
    By akash211 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 11-24-2014, 05:36 AM
  2. Hi, I'm new here, looking for a few solutions
    By Gifted Ed in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 11-17-2014, 08:58 PM
  3. Solutions for Data
    By mathanraj76 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-09-2013, 09:34 AM
  4. IF with 3 possible solutions
    By jomili in forum Excel General
    Replies: 6
    Last Post: 09-14-2010, 08:41 AM
  5. Explaining Your Solutions
    By papaexcel in forum ExcelTip.com Feedback / Comments / Suggestions
    Replies: 8
    Last Post: 12-11-2009, 05:00 PM
  6. vba solutions a.s.a.p please
    By RELWOD85 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2005, 01:05 AM
  7. Are there any solutions for truckers?
    By Driver in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-23-2005, 05:07 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