Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If, then, true, false
I guess the best way to describe the problem is to explain what I would like
to do. If I paste the number 1 in cell A1, then I would like the number I post in cell B1 to be a negative number. If the number in cell A1 is a 2 or greater I would like the number to be a positive number in cell B1. The number I paste in B1 could also be a fractional number such as 2 ¼. I would need to convert the fraction to a decimal. Again as I stated in a previous post, if these functions were possible, it would reduce my time in coming to an end result. Please advise if I have to use additional columons to acheive this |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If, then, true, false
Right-click on the sheet tab and "View Code"
Copy/paste this event code into that sheet module. Private Sub Worksheet_Change(ByVal Target As Range) Set tval = Target Set xval = Range("B1") If Intersect(tval, xval) Is Nothing Then Exit Sub Application.EnableEvents = False With xval If .Offset(0, -1).Value = 1 Then .Value = .Value * -1 Else: .Value = .Value End If End With Application.EnableEvents = True End Sub As far as entering fractions like 2 1/4, simply format B1 as number. Gord Dibben MS Excel MVP On Sat, 29 Aug 2009 11:15:01 -0700, hollywood wrote: I guess the best way to describe the problem is to explain what I would like to do. If I paste the number 1 in cell A1, then I would like the number I post in cell B1 to be a negative number. If the number in cell A1 is a 2 or greater I would like the number to be a positive number in cell B1. The number I paste in B1 could also be a fractional number such as 2 ¼. I would need to convert the fraction to a decimal. Again as I stated in a previous post, if these functions were possible, it would reduce my time in coming to an end result. Please advise if I have to use additional columons to acheive this |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
=IF(test,true,false) only ever returns "true"? | Excel Worksheet Functions | |||
What's the best way to toggle between true and false in Excel? Hiall, My excel work involves a lot of toggling between true and false (booleantypes) ... and it's very repetitive... Is there a way to select a bunch ofcells, and press a key short-cu | Excel Discussion (Misc queries) | |||
Search for 2 true arguments and return true or false | Excel Discussion (Misc queries) | |||
Function to return True/False if all are validated as True by ISNU | Excel Worksheet Functions | |||
Reverse false and combine with true true value | Excel Worksheet Functions |