Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default different formulas based on different inputs

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default different formulas based on different inputs

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" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default different formulas based on different inputs

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" wrote in message
...
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
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
CF to distinguish Formulas from Inputs Brian Ballek Excel Worksheet Functions 7 August 7th 07 01:37 AM
how do i select data based on two inputs in excel Bluebell New Users to Excel 3 August 28th 06 06:34 PM
How to rearrange order based on dates of inputs? FISH Charts and Charting in Excel 2 September 21st 05 01:06 PM
How to rearrange order based on dates of inputs? FISH Excel Programming 2 September 21st 05 01:06 PM
Formulas not updating when add new inputs Teresa[_2_] Excel Programming 4 April 21st 04 05:49 PM


All times are GMT +1. The time now is 11:27 PM.

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"