link goal with excel in goal seek macro

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: link goal with excel in goal seek macro

  1. #1
    New Member
    Join Date
    Apr 2007
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default link goal with excel in goal seek macro

     
    Hello,
    I recorded a macro for a goal seek and goal cell and variable input I can link to excel, however if I want to change the goal value, I have to go into the macro and change it there.
    Tried to name the goal cell and enter that in the macro, but that doesn't work.
    Anyone has a solution?

  2. #2
    Board Regular
    Join Date
    Oct 2007
    Location
    Kuwait
    Posts
    174
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: link goal with excel in goal seek macro

    Hello Dolf,

    It would be easier to solve your issue if you post your code. However, I have just set the below example for you perhaps it clarifies things out

    Code:
    Sub Macro1()
    
    Dim Goal_Value As Double
    Goal_Value = ActiveSheet.Range("A1").Value ' Change this to the desired sheet/cell reference
    
    Range("C6").GoalSeek Goal:=Goal_Value, ChangingCell:=Range("C4")
    
    End Sub
    Last edited by mse330; Nov 28th, 2017 at 12:43 PM. Reason: Correcting the code

    Check the List of BB codes


  3. #3
    New Member
    Join Date
    Apr 2007
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: link goal with excel in goal seek macro

    Thanks mse330! I think I understand what you mean, I'll give it a try

  4. #4
    New Member
    Join Date
    Apr 2007
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking Re: link goal with excel in goal seek macro

    Quote Originally Posted by Dolf View Post
    Thanks mse330! I think I understand what you mean, I'll give it a try
    Super it works!!! Thanks a lot

  5. #5
    Board Regular
    Join Date
    Oct 2007
    Location
    Kuwait
    Posts
    174
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: link goal with excel in goal seek macro

      
    Great .. I am glad I could help & thanks for reporting back

    Check the List of BB codes


User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com