#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default ComboBox code

Hi
I want to place one combobox on sheet2, to do a list of some itens located
on sheet 1.
With validation donīt work, because data is on sheet1 and combobox on sheet2
I donīt want to use forms.
I think than there is a way to insert code on the cell, but i don't know...
please somebody help me!!!
Thanks



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 39
Default ComboBox code

Alexandre Ferreira wrote:
Hi
I want to place one combobox on sheet2, to do a list of some itens located
on sheet 1.
With validation donīt work, because data is on sheet1 and combobox on sheet2
I donīt want to use forms.
I think than there is a way to insert code on the cell, but i don't know....
please somebody help me!!!
Thanks


You can use validation if you trick excel.
Let's say you have the following on sheet1
A1 - first
A2 - second
A3 - third
A4 - fourth
and you want them to be in a combobox on sheet 2
Add validation as you normally would
(Validation-Settings-Allow-Lists) and for the source, use the
INDIRECT function to wrap the range address.
e.x. Source: =INDIRECT("'Sheet1'!A1:A4") and you'll have a working
combobox with the options from sheet1. (Make sure you use an apostrophe
when sheet names have spaces in them)

If for some reason that solution is not acceptable, you can also use a
control combobox instead of a form combobox. You can add it from the
control toolbox (Edit-toolbars-control toolbox)
After adding/sizing the combobox, you can link it by right clicking it
(assuming you are in design mode) and selecting "properties". Under
properties, find "ListFillRange" and type in the address that you want
to link to (i.e. =Sheet1!A1:A4). Once you exit design mode, the
combobox should work properly.
You can also fill the combobox using code. If that is your intention,
please let me know.
One final note - If you use the control combobox and you have macros in
the workbook; if you disable macros when the workbook is opened, it
will disable the combobox as well.
Validation and forms comboboxes will still work if macros are disabled.
I hope this helps.

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
Cell value not recognized by code. Brady Excel Discussion (Misc queries) 8 December 21st 06 02:56 AM
Macro Help (Uppercase multiple ranges?) Ken Excel Discussion (Misc queries) 14 December 2nd 06 07:23 PM
Code to prevent Remove Split or Unfreeze Panes? dk_ Excel Discussion (Misc queries) 6 October 9th 06 08:35 PM
Text formatting Kace Excel Worksheet Functions 1 September 18th 06 08:28 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM


All times are GMT +1. The time now is 07:57 AM.

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"