goal seek and vba

pbarreda77

New Member
Joined
Aug 12, 2002
Messages
25
Sub goalseek()

Range("AB100").goalseek Goal:=0, ChangingCell:=Range("AB104")
End Sub

Above is a macro for goalseek can anyone help with how to write the vba code that would allow me to run goalseek on say 10 cells from left to right all cells being in row 100. Example the next goalseek would use "AC100" and "AC104" etc etc etc

thank you all
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

pbarreda77

New Member
Joined
Aug 12, 2002
Messages
25
Ladies and Gents I think I 've got it

Sub Commandbutton_click()
Dim i as integer

For i 5 to 100
cells.Item(100,i).select
Selection.goalseek goal:=0, ChangingCell:=selection.Offset(4,0)

Next i

End Sub
This message was edited by pbarreda77 on 2002-10-29 11:15
 
Upvote 0

Forum statistics

Threads
1,186,327
Messages
5,957,229
Members
438,294
Latest member
Soikeo79

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
Top