PC Review


Reply
Thread Tools Rate Thread

different formulas based on different inputs

 
 
jeffery
Guest
Posts: n/a
 
      2nd Nov 2009
I have 3 columns: PriceA, PriceB, PriceC.

For each row, If I input one of the prices, I want the other 2 to be
calculated off of the entered price.
Each entered Price, has a different set of calculated formulas.

How do I set this up so whichever one I enter, the others get calculated?

I think this would be an worksheet_change event, but am not sure.

Thanks for the help,

Jeff Gray
 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      2nd Nov 2009
Assuming those three columns are A, B and C, then basically you would set it
up like this...

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 1 Then
' Do calculations for Columns B & C when entry is in Column A
ElseIf Target.Column = 2 Then
' Do calculations for Columns A & C when entry is in Column B
ElseIf Target.Column = 3 Then
' Do calculations for Columns A & B when entry is in Column C
End If
Application.EnableEvents = True
End Sub

Of course, this doesn't show an error handling routines your coding may
require.

--
Rick (MVP - Excel)


"jeffery" <(E-Mail Removed)> wrote in message
news4C3376D-830B-4D21-AB90-(E-Mail Removed)...
>I have 3 columns: PriceA, PriceB, PriceC.
>
> For each row, If I input one of the prices, I want the other 2 to be
> calculated off of the entered price.
> Each entered Price, has a different set of calculated formulas.
>
> How do I set this up so whichever one I enter, the others get calculated?
>
> I think this would be an worksheet_change event, but am not sure.
>
> Thanks for the help,
>
> Jeff Gray


 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      2nd Nov 2009
If you do not use a UserForm with some text boxes or labels to do the
calculations, you would have to use event code in the worksheet to trigger
the calculation. Alternatively, you could set up command buttons on the
sheet with macros attached to do the initiate the calculations. But if you
want it to be done upon entry on the sheet, then the Change event is
probably the trigger you are looking for.



"jeffery" <(E-Mail Removed)> wrote in message
news4C3376D-830B-4D21-AB90-(E-Mail Removed)...
>I have 3 columns: PriceA, PriceB, PriceC.
>
> For each row, If I input one of the prices, I want the other 2 to be
> calculated off of the entered price.
> Each entered Price, has a different set of calculated formulas.
>
> How do I set this up so whichever one I enter, the others get calculated?
>
> I think this would be an worksheet_change event, but am not sure.
>
> Thanks for the help,
>
> Jeff Gray



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visible control based on other inputs Ticotion Microsoft Access Form Coding 2 17th Nov 2009 02:20 PM
CF to distinguish Formulas from Inputs Brian Ballek Microsoft Excel Worksheet Functions 7 7th Aug 2007 01:37 AM
Find value in table based on two inputs AMDRIT Microsoft Excel Discussion 3 30th Dec 2005 04:45 PM
Generating Reports Based on inputs =?Utf-8?B?QmFnaHphYWQ=?= Microsoft Access Reports 0 17th Nov 2004 04:12 PM
Formulas not updating when add new inputs Teresa Microsoft Excel Programming 4 21st Apr 2004 05:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:59 PM.