| View previous topic :: View next topic |
| Author |
Message |
0x00x0 Newbie

Joined: 22 Apr 2007 Posts: 4
|
Posted: Sun Apr 22, 2007 10:48 am Post subject: Linking combo box to spreadsheet cell |
|
|
I'm trying to link the selected index of a combo box (drop down menu) to a specific cell. Something along these lines:
IF(comboBox.selection=1)
C2=$1200;
ELSE C2=$1000
is there a way to reference a combo box in Calc in an IF statement, or perhaps there is a better way.
Thanks in advance for your help. |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Sun Apr 22, 2007 11:14 am Post subject: |
|
|
Link your combobox to one cell and use a formula in another one:
=IF(linkedCell;1200;1000) or =1000+linkedCell*200 _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
0x00x0 Newbie

Joined: 22 Apr 2007 Posts: 4
|
Posted: Sun Apr 22, 2007 11:36 am Post subject: |
|
|
Villeroy,
Thanks for the quick reply. Your idea is very good, can an IF statement evaluate strings as true or false. for example, can I: =IF(F2="Shop";80;140) ?
If not, is there a way to make my combo box whose contents are "Shop, OnSite, Remote and Phone" evaluate boolean? Thanks again for your help. |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Sun Apr 22, 2007 11:40 am Post subject: |
|
|
Simply try. Your formula looks good. _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
0x00x0 Newbie

Joined: 22 Apr 2007 Posts: 4
|
Posted: Sun Apr 22, 2007 1:20 pm Post subject: |
|
|
Hey thanks again, that worked perfectly. I really appreciate it.
I'm getting quite a bit ahead of myself here, but is it possible to populate a combo box with a column on another spreadsheet? I don't really need to know how yet, just trying to develop a solution here for the long run. Thanks again. |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Mon Apr 23, 2007 11:40 am Post subject: |
|
|
You can set a source-range like A1:A10 or Sheet2.A1:A10. Have a look in the dialogue where you defined the linked cell.
Then you may give a try with Menu:Data>Validity...Type:"Range" or "List". This will turn a cell itself into a listbox. _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
0x00x0 Newbie

Joined: 22 Apr 2007 Posts: 4
|
Posted: Mon Apr 23, 2007 12:01 pm Post subject: |
|
|
Thank you very much, that is exactly the solution I'm looking for.
I very much appreciate your help, thanks again. |
|
| Back to top |
|
 |
|