Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Formula for multiple cells

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 207
Default Formula for multiple cells

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Formula for multiple cells

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Formula for multiple cells

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Formula for multiple cells

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
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
Using the LEFT formula for multiple cells Emily G Excel Worksheet Functions 3 April 25th 23 09:09 AM
how do i use multiple cells to create a formula ? Rob Welsh (Austin) Excel Discussion (Misc queries) 5 February 24th 10 05:28 PM
Formula for multiple cells spezticle Excel Worksheet Functions 0 July 26th 08 06:09 AM
Using one cells formula in multiple other cells Eric Excel Discussion (Misc queries) 1 June 18th 08 12:15 AM
Look up formula, multiple cells pgarcia Excel Discussion (Misc queries) 8 January 30th 07 10:28 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"