VBA goal-seek

Jeff12

New Member
Joined
Aug 28, 2011
Messages
16
I have a named range called Periods which = 45 and i want this cell to change the range below. How do I change Range.("N45") to pick up column N but pick up the name range Periods which will be changed by the user?

Sub Macro1()
'
' Macro1
'
'
Sheets("Cashflow").Range("N45").GoalSeek Goal:=0, ChangingCell:=Range("G8")
End Sub

thanks Jeff
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Maybe try:

Code:
Sheets("Cashflow").Range("N" & Range("Periods").Value).GoalSeek Goal:=0, ChangingCell:=Range("G8")
 
Upvote 0
Try:

Sheets("Cashflow").Range("N" & (Range("Periods").Value + 5)).GoalSeek Goal:=0, ChangingCell:=Range("G8")
 
Upvote 0

Forum statistics

Threads
1,221,825
Messages
6,162,190
Members
451,752
Latest member
majbizzaki

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