Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Dialog Box returning Array Value instead of Actual List Value

I am using XP 2002, SP1. I typically use Excel to perform simple math but
now am dabbling in some more advanced areas. Please excuse me if I misuse
any terms... I am trying to build a Dialog Box which eases data entry for
the user while still applying the Validation of List Boxes for data
selection. The Dialog Box displays several List Boxes for the user to
populate, and the Lists of data are displaying appropriately to the user.
However, when I bind the selected values of each box to another cell in my
workbook (I'm using the workbook as a source for a mail merge to a word doc),
the destination cell is returning the array value instead of the actual value
as displayed on the list. For example, the list box shows: dog, cat, mouse.
The user selects cat. The value returned in the destination cell is '2' not
'cat'.

Can anyone help me out here?

TIA
Angela
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Dialog Box returning Array Value instead of Actual List Value

What is the statement that transfers your data from listbox to cell?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Dialog Box returning Array Value instead of Actual List Value

I'm not sure I can elaborate very well.

I am using the Forms Toolbar to add the Combo Boxes to the Dialog Box. When
I want to add the list of values to the Combo Box, I select Format Control.
I get a box, (actually a dialog box I think) which has several tabs. I pick
the Control tab, which then allows me to specify the Input Range, Cell Link,
and Drop Down Lines.

It's the Cell Link field that allows me to direct data from Combo Box to
cell...

I'm digging around trying to understand Combo Boxes and Matching, and
Indexing... It's the fact that it's a Combo Box that is throwing back the
array position (I think)

Since I don't know the code, if I should be in another forum, feel free to
send me packing... I can post this in General if that would be more
appropriate.

Thanks for any help you can give!
-Angela

"Mark" wrote:

What is the statement that transfers your data from listbox to cell?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Dialog Box returning Array Value instead of Actual List Value

That is (for better or worse) the way the combobox in the forms controls
works on a spreadsheet. What goes into the "Cell Link" is the numerical
index of the selected choice, not the choice itself. You can get around this
by using the controls from the Control Toolbox, which are ActiveX controls
and behave differently - they are more flexible from a programming
standpoint, but it also means they are more complex to use.

But, here is the usual solution if you need to use the value that was
selected. You can write a formula in a cell (different from the "Cell Link")
that finds the value from your Input Range. For the example I will assume
the input range is vertical (i.e. a column) starting in cell A1 and the cell
link is B1 - the formula would be:
=OFFSET(A1,B1-1,0)
--
- K Dales


"ChickenMunk" wrote:

I'm not sure I can elaborate very well.

I am using the Forms Toolbar to add the Combo Boxes to the Dialog Box. When
I want to add the list of values to the Combo Box, I select Format Control.
I get a box, (actually a dialog box I think) which has several tabs. I pick
the Control tab, which then allows me to specify the Input Range, Cell Link,
and Drop Down Lines.

It's the Cell Link field that allows me to direct data from Combo Box to
cell...

I'm digging around trying to understand Combo Boxes and Matching, and
Indexing... It's the fact that it's a Combo Box that is throwing back the
array position (I think)

Since I don't know the code, if I should be in another forum, feel free to
send me packing... I can post this in General if that would be more
appropriate.

Thanks for any help you can give!
-Angela

"Mark" wrote:

What is the statement that transfers your data from listbox to cell?


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
Formula/calculation returning a 0 instead of actual sum Jenny Beech Excel Worksheet Functions 4 November 19th 09 06:11 PM
Retrieving last actual value in a list jonny Excel Discussion (Misc queries) 5 April 11th 08 01:55 PM
Vlookup: returning the value below the actual row starguy Excel Discussion (Misc queries) 4 August 3rd 06 11:44 AM
Returning actual page field changed in pivottable Grant Excel Programming 0 September 27th 04 01:02 AM
variant array containing cel adresses convert to actual ranges-array Peter[_21_] Excel Programming 5 December 10th 03 09:50 PM


All times are GMT +1. The time now is 04:13 PM.

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"