Trying to apply Solver with Macros

0 votes

I already added the Solver Reference on my Active Module.

I used this code to get familiar with Macros for Solver but dosent work, dosent even give me an error. ¿Can you guy tip me pls?

Sub SolverMacro()
    
    SolverReset
    SolverOk SetCell:="$R$2", MaxMinVal:=0, ValueOf:=0.1, ByChange:="$I$2", Engine:=1, EngineDesc:="GRG Nonlinear"
    SolverSolve True
    
End Sub

My objective is to make cell R2 10% by changing cell I2. With out Macros it works perfectlly.

enter image description here

Jan 10, 2023 in Others by Kithuzzz
• 38,000 points
386 views

1 answer to this question.

0 votes

The  MaxMinVal was when you wanted to insert a Max value or a Min value, but actually it is for choosing a parameter, like this:

MaxMinVal: This is an optional parameter. Below are numbers and specifiers:

  • 1 = Maximize
  • 2 = Minimize
  • 3 = for Match a specific value
answered Jan 10, 2023 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
1 answer

I am trying to run following command But I end up with an error :

Hii Nishant, You are running this command inside ...READ MORE

answered Apr 6, 2020 in Others by Niroj
• 82,840 points
1,856 views
0 votes
0 answers
0 votes
1 answer

It shows black screen when trying to load Map on device with ionic 2 Google Map Native plugin

In order to answer your question, start ...READ MORE

answered Feb 8, 2022 in Others by Rahul
• 9,680 points
1,754 views
0 votes
1 answer

How to communicate gRPC example working with Node.js?

hi.. you can read below link, it ...READ MORE

answered Dec 2, 2019 in Others by Narendra Reddy Dalli
2,374 views
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,740 points
1,212 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
3,664 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9, 2022 in Others by gaurav
• 23,260 points
908 views
0 votes
2 answers

How to copy a formula horizontally within a table using Excel VBA?

Hi so basically, create an adjacent column ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,690 points
1,053 views
0 votes
1 answer

How to Freeze Top Row and Apply Filter in Excel Automation with C#

Try this: // Fix first row workSheet.Activate(); workSheet.Application.ActiveWindow.SplitRow = 1; workSheet.Application.ActiveWindow.FreezePanes ...READ MORE

answered Oct 22, 2022 in Others by narikkadan
• 63,600 points
2,645 views
0 votes
1 answer

Trying to run different macros based on value of cell in a range

This demonstrates one approach to loop through ...READ MORE

answered Jan 19, 2023 in Others by narikkadan
• 63,600 points
448 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP