Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I need to be able to input a number in cells a1 through a10.
I need those numbers to reflect a formula, IN the cell i typed the number in. Example: cell a4, i type in 4. the formula multiplies 4 * .01 (turning 4 into a percent number) THEN by 2000. So, when i input the number 4, i get displayed 80. Any insight is much appreciated. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
spezticle,
Try this : In cell A4 4 In cell that you want the 80 to appear type "=((A4*0.01)*2000)" without the "". hth Dennis "spezticle" wrote: I need to be able to input a number in cells a1 through a10. I need those numbers to reflect a formula, IN the cell i typed the number in. Example: cell a4, i type in 4. the formula multiplies 4 * .01 (turning 4 into a percent number) THEN by 2000. So, when i input the number 4, i get displayed 80. Any insight is much appreciated. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You can't change the value in a cell with a formula in that cell (think
about it... you enter the number and it overwrites the formula). You also can't change the value in a cell by using formatting (formatting only changes the display of the number, not it value... making a 4 into an 80 is changing the value). You can do what you want with using a worksheet event procedure though (this involves some VB code). Right click the tab on the worksheet where you want this functionality and copy/paste the following code into the code window that appears... Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("A1:A10")) Is Nothing Then Application.EnableEvents = False Target.Value = 20 * Target.Value End If Whoops: Application.EnableEvents = True End Sub Note that all this code is doing is multiplying your entry by 20. Multiplication is not dependent on the order in which it is performed; so when you said to do what amounted to this... (Entry * 0.1) * 2000 that is no different than doing this... Entry * (0.1 * 2000) == Entry * 20 Rick "spezticle" wrote in message ... I need to be able to input a number in cells a1 through a10. I need those numbers to reflect a formula, IN the cell i typed the number in. Example: cell a4, i type in 4. the formula multiplies 4 * .01 (turning 4 into a percent number) THEN by 2000. So, when i input the number 4, i get displayed 80. Any insight is much appreciated. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Rick
I think you forgot the On Error Goto Whoops Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("A1:A10")) Is Nothing Then On Error Goto Whoops Application.EnableEvents = False Target.Value = 20 * Target.Value End If Whoops: Application.EnableEvents = True End Sub Gord On Sat, 26 Jul 2008 05:26:07 -0400, "Rick Rothstein \(MVP - VB\)" wrote: Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("A1:A10")) Is Nothing Then Application.EnableEvents = False Target.Value = 20 * Target.Value End If Whoops: Application.EnableEvents = True End Sub |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I was thinking that code looked too short when I posted it.<g What happened
was I was getting ready to go to sleep for awhile and I wrote up the code (with the On Error in it), tested it and then went to copy it into the Clipboard to paste into a response to the OP... Excel crashed. Of course, my code was not in the recovery worksheet; so I wrote it up again quickly (remember, I was trying to go to sleep) and obviously forgot to include the On Error statement. Thanks for catching my omission. Rick "Gord Dibben" <gorddibbATshawDOTca wrote in message ... Rick I think you forgot the On Error Goto Whoops Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("A1:A10")) Is Nothing Then On Error Goto Whoops Application.EnableEvents = False Target.Value = 20 * Target.Value End If Whoops: Application.EnableEvents = True End Sub Gord On Sat, 26 Jul 2008 05:26:07 -0400, "Rick Rothstein \(MVP - VB\)" wrote: Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("A1:A10")) Is Nothing Then Application.EnableEvents = False Target.Value = 20 * Target.Value End If Whoops: Application.EnableEvents = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using the LEFT formula for multiple cells | Excel Worksheet Functions | |||
how do i use multiple cells to create a formula ? | Excel Discussion (Misc queries) | |||
Formula for multiple cells | Excel Worksheet Functions | |||
Using one cells formula in multiple other cells | Excel Discussion (Misc queries) | |||
Look up formula, multiple cells | Excel Discussion (Misc queries) |