Goal Seek Macro

Greg Determann

New Member
Joined
Jan 18, 2005
Messages
20
I am just getting my feet wet in VBA and have a question.

I am trying to figure out how to write a macro that will look at cell C3 and C4 and determine which one is lower. If c3 is lower, then set it to a value of 0 by changing cell c2 and then move onto the next column. Eventually, the number in row 4 will be smaler than the row 3 value. At that pt I need it to goal seek to set the row 4 number to zero by still changing the corresponding row 2 value. After that, it is finished. Any ideas?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Greg,

just getting your feet wet?
then take it step by step

let's first try to compare two cells
my question to you : can c3 = c4 ?

Code:
Sub Macro1()
If Range("C3") < Range("C4") Then MsgBox Range("C3") & " < " & Range("C4")
End Sub

can you make this work?
try then to make some variations on this theme...

kind regards,
Erik
 
Upvote 0
Fine, Greg,

Perhaps some people were busy to help you or others will come back for the solution. So please post how you solved this.

kind regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,213,524
Messages
6,114,117
Members
448,549
Latest member
brianhfield

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top