Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Lisa H via OfficeKB.com
 
Posts: n/a
Default formulas from a drop down box

I was wondering if it is possible to have a list of formulas in a drop down
box so that when I pick a formula, that is the one that is applied to that
cell. Any help would be great.
  #2   Report Post  
Jim Cone
 
Posts: n/a
Default

Lisa,

The following uses a Combobox from the forms toolbar.
It assumes that Combobox has been assigned a single
column list range where the formulas are shown.
The first item in that list should be a title, such as "Formulas",
while the rest of the list should be the actual formulas without
the leading equal sign "=".
The linked cell for the combobox must also have been assigned.

'--------------------------------
Sub FormulaToActiveCell()
'Places selection from combobox in the active cell.
Dim rngFormulas As Excel.Range

'The combobox is named 'Drop Down 1"
With ActiveSheet.Shapes("Drop Down 1").ControlFormat
Set rngFormulas = ActiveSheet.Range(.ListFillRange)
'So you won't overwrite your own formulas.
If Application.Intersect(rngFormulas, ActiveCell) Is Nothing Then
ActiveCell.Formula = "=" & rngFormulas(Range(.LinkedCell).Text)
End If
'Reset display value in the combobox
Range(.LinkedCell).Value = 1
End With

Set rngFormulas = Nothing
End Sub
'---------------------------------

Regards,
Jim Cone
San Francisco, USA


"Lisa H via OfficeKB.com"
wrote in message
...
I was wondering if it is possible to have a list of formulas in a drop down
box so that when I pick a formula, that is the one that is applied to that
cell. Any help would be great.

  #3   Report Post  
Lisa H via OfficeKB.com
 
Posts: n/a
Default

It kind of works the formulas I am entering look like this except the N2
values would change depending on what day it is (there are a total of 15
lines including "Formulas")
IF((n2/SUM(M15:M21)<1),n2/SUM(M15:M21),100%) - but when I click on one of
the formula options it gives me 200% or the next one gives me 300% as so on
down to 1500%. What am I doing wrong?!

--
Message posted via http://www.officekb.com
  #4   Report Post  
Jim Cone
 
Posts: n/a
Default

Why don't you highlight logical portions of the formula in
the formula bar and press the F9 key. That will give you
the values the formula is working with and should
help you determine what going on.
One issue, I can see is that "n2" should be N2.
If Excel was recognizing it as a cell reference, it would
be capitalized.

Jim Cone
San Francisco, USA


"Lisa H via OfficeKB.com" wrote in message
...
It kind of works the formulas I am entering look like this except the N2
values would change depending on what day it is (there are a total of 15
lines including "Formulas")
IF((n2/SUM(M15:M21)<1),n2/SUM(M15:M21),100%) - but when I click on one of
the formula options it gives me 200% or the next one gives me 300% as so on
down to 1500%. What am I doing wrong?!

  #5   Report Post  
Lisa H via OfficeKB.com
 
Posts: n/a
Default

Okay I went through and capitalized them all and checked the values they
are using and it's coming up correct is there something I am missing?
Unfortunatley I am a self taught Excel user and I just can't figure out
what I am doing wrong.

--
Message posted via http://www.officekb.com


  #6   Report Post  
Jim Cone
 
Posts: n/a
Default


You do not have to capitalize the entries. If Excel believes
what it sees is a formula it capitalizes the cell references by itself.
Since it didn't, that means there is something wrong with the entry.

One more thing you can do is verify that the cells, to which you are
transferring the formulas are formatted, as General not Text.

Jim Cone


"Lisa H via OfficeKB.com" wrote in message ...
Okay I went through and capitalized them all and checked the values they
are using and it's coming up correct is there something I am missing?
Unfortunatley I am a self taught Excel user and I just can't figure out
what I am doing wrong.

--
Message posted via http://www.officekb.com

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
Help, Urgent Excel Formulas are not calculating maashoff Excel Discussion (Misc queries) 1 May 3rd 05 12:25 AM
automatic color change in cells using a drop down list kennethwt Excel Worksheet Functions 1 January 21st 05 06:37 PM
Problem with named formula's nathan Excel Worksheet Functions 0 January 21st 05 04:07 PM
formulas involving a drop down list Nat Excel Worksheet Functions 1 November 26th 04 07:27 PM
calculating formulas for all workbooks in a folder Chad Excel Worksheet Functions 3 November 13th 04 05:22 PM


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