PC Review


Reply
Thread Tools Rate Thread

Automate GoalSeek

 
 
Gunnar Lysaker
Guest
Posts: n/a
 
      17th Dec 2008
Hi,

When I start this For
"For introw = 137 To 139" it is something wrong. Anyhelp out there?

---

Sub Macro3()
Dim introw As Integer
Dim introw2 As Integer
Dim ShtSpread As Worksheet
Set ShtSpread = Sheets("2009Analyse")
ShtSpread.Activate
Dim Gunnar As Long

Set introw = 137

Set mycell = Range("R" & "introw2")
Set introw2 = 137
For introw = 137 To 139
Range("R" & "introw2).GoalSeek Goal:=0.063,
ChangingCell:=Range("M"&introw)

introw2 = introw2 + 1
introw = introw + 1

Next introw


End Sub
 
Reply With Quote
 
 
 
 
Michael
Guest
Posts: n/a
 
      17th Dec 2008
Set introw2 = 137 should placed before Set mycell = Range("R" & "introw2")
otherwise you will get R and Empty
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Gunnar Lysaker" wrote:

> Hi,
>
> When I start this For
> "For introw = 137 To 139" it is something wrong. Anyhelp out there?
>
> ---
>
> Sub Macro3()
> Dim introw As Integer
> Dim introw2 As Integer
> Dim ShtSpread As Worksheet
> Set ShtSpread = Sheets("2009Analyse")
> ShtSpread.Activate
> Dim Gunnar As Long
>
> Set introw = 137
>
> Set mycell = Range("R" & "introw2")
> Set introw2 = 137
> For introw = 137 To 139
> Range("R" & "introw2).GoalSeek Goal:=0.063,
> ChangingCell:=Range("M"&introw)
>
> introw2 = introw2 + 1
> introw = introw + 1
>
> Next introw
>
>
> End Sub

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Goalseek jkrons Microsoft Excel New Users 0 5th Oct 2010 11:36 AM
Multiple goalseek - pls pls help transferxxx@gmail.com Microsoft Excel Programming 0 26th Jul 2007 09:58 PM
GoalSeek .NET Alternative William Foster Microsoft VB .NET 0 23rd Jul 2006 08:39 AM
GoalSeek in VBA alundlarsen@gmail.com Microsoft Excel Misc 1 20th Jul 2006 05:13 AM
Goalseek / Solver Target Value msnews.microsoft.com Microsoft Excel Worksheet Functions 1 2nd Dec 2005 01:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:58 AM.