Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
LCA LCA is offline
external usenet poster
 
Posts: 2
Default Using Goal Seek without a macro

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Using Goal Seek without a macro

LCA,

You will have to write the following in the Cash Flows 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


"LCA" wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Goal seek via macro? Ken G. Excel Discussion (Misc queries) 2 April 3rd 09 09:48 AM
Goal Seek in a Macro mrogge2895 Excel Discussion (Misc queries) 1 November 20th 08 11:37 PM
Macro help for goal seek Dean[_8_] Excel Programming 2 December 19th 05 05:24 AM
Goal Seek tool in a macro choboy Excel Discussion (Misc queries) 0 April 27th 05 09:22 AM
Goal Seek macro Jeff Excel Programming 1 October 12th 04 09:23 PM


All times are GMT +1. The time now is 12:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"