Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default 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
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
=IF(test,true,false) only ever returns "true"? TagTech Excel Worksheet Functions 5 December 10th 08 04:04 PM
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 LunaMoon Excel Discussion (Misc queries) 9 July 29th 08 12:28 AM
Search for 2 true arguments and return true or false David Excel Discussion (Misc queries) 3 July 15th 06 10:18 AM
Function to return True/False if all are validated as True by ISNU Tetsuya Oguma Excel Worksheet Functions 2 March 15th 06 11:28 AM
Reverse false and combine with true true value Emmie99 Excel Worksheet Functions 5 August 17th 05 04:38 PM


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