Using Goal Seek without a macro

L

LCA

if any cell in my workbook changes, what VBA code do I need to get goal seek
to run automatically without calling a macro? I do not want my users to have
to call a macro but rather just put in their inputs in any other cells and
have goal seek automatically calculate. This is what I have so far - what am
I missing?

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
Sheets("Cash Flow").Select
Range("d35").GoalSeek Goal:=0#, ChangingCell:=Range("b34")
End Sub
 
C

Cavy

LCA,

You will have to write the following in the Cash Flow’s sheet code (not in a
module)

Private Sub Worksheet_Change(ByVal Target As Range)
Worksheets("Cash Flow").Range("D35").GoalSeek Goal:=0,
ChangingCell:=Sheets("Cash Flow").Range("B34")
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top