Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Clayton
 
Posts: n/a
Default Comparing the active cell value against another value in the row

I have two values in a row, I want to click on the active cell and have it
display a calculation based on the value in the active cell versus a fixed
cell in the same row. I have tried to use the msgbox function but can't seem
to make it work. The values are consist of a customer discount off list
versus a dealer discount off list. I need to calculate the margin based on
these two values. The formula is 1-((1-dealer discount)/(1-customer
discount)). Can this be done in Visual basic?
  #2   Report Post  
Posted to microsoft.public.excel.misc
mrice
 
Posts: n/a
Default Comparing the active cell value against another value in the row


I would suggest a simple macro based upon the Worksheet_SelectionChange
event

Something like

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target = "" Then Exit Sub
MsgBox Target - Range("A1")
End Sub

for a simple subtraction which you can amend for your specific formula.


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=549171

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
Active cell moves off the screen John W. Excel Discussion (Misc queries) 1 November 15th 05 11:12 PM
Active Cell displayed in another cell? Rich Excel Discussion (Misc queries) 3 August 6th 05 04:55 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Woorksheet locked on active cell ESD Excel Worksheet Functions 1 March 18th 05 02:22 PM
Highlight Active Cell...With a Diffrence Peter Excel Discussion (Misc queries) 1 January 31st 05 01:18 PM


All times are GMT +1. The time now is 12:35 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"