simple question to repeat macro

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

koukou

Thread Starter
Joined
Apr 5, 2008
Messages
5
This is the macro I have from simply recording macro, basically i want to have solve for column c here C1 to be zero by changing cell of column E here E1.

Sub Macro1()
'
' Macro1 Macro
'

'
SolverOk SetCell:="$C$1", MaxMinVal:=3, ValueOf:="0", ByChange:="$E$1"
SolverSolve
End Sub

I would like the macro to do the same for cell C2 changing E2 until the cell C100 when changing E 100

How can I do this? It is my first time using this...
Thanks a lot.
 
Joined
Apr 7, 2007
Messages
439
I don't use Solver, but a simple For Loop should do the trick:
Sub Macro1()
Dim i as Integer
For i = 1 to 100
SolverOk SetCell:="$C" & i, MaxMinVal:=3, ValueOf:="0", ByChange:="$E" & i
SolverSolve​
Next i
End Sub
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top