+ Reply to Thread
Results 1 to 6 of 6

Macro - Repeat macro a specific number of times

  1. #1
    Registered User
    Join Date
    02-18-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2010
    Posts
    3

    Post Macro - Repeat macro a specific number of times

    Hi everyone,

    I'm working with an assignment and i have come across following problem.

    I need to run the following solver macro for the objective cell range P25:P78.

    what I'm doing is, I enter a value to the G25 (actually values to the cell range G25:G78). Here G25=260.
    I need to get the root of the equation entered in the objective cell(P25) and root will be displayed in the J25.
    The following code is generated for P25. I need to get a code to repeat this process in the cell range P25:P78.

    Please Login or Register  to view this content.
    Please help me.
    Thanx in advance!!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro - Repeat macro a specific number of times

    Untested - but you can try this -
    Please Login or Register  to view this content.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    02-18-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro - Repeat macro a specific number of times

    Hi,
    Thanx for your help. I think I got it correct after some adjustments. here is my new code.

    Please Login or Register  to view this content.
    In this way I'm getting my solution but for each and every cell($P$) the solver results pop-up window appears and I have to click the "OK" for 54 times. Is there any way to avoid that.

    In my solution I have removed
    Please Login or Register  to view this content.
    part because I'm entering different values(not 260 for all the cells).
    Is there any method to write a code to get "the value I'm entering" instead of "260".

    Thanx for the help!!

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro - Repeat macro a specific number of times

    To get rid of the pop-up window use

    Please Login or Register  to view this content.
    I would also recomend adding the line

    Please Login or Register  to view this content.
    to avoid buildup of the same constraint.

    Alf
    Last edited by Alf; 02-25-2013 at 03:18 AM. Reason: seems I can't spell

  5. #5
    Registered User
    Join Date
    02-18-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro - Repeat macro a specific number of times

    Hi,
    It's working nicely. this is what I required. thanx for all!!

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro - Repeat macro a specific number of times

    Thanks for feedback and rep!

    Alf

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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