change control listbox results to numbers

G

Gmann

I have a listbox (activex control) in an excel worksheet, it returns
"text" value to the linked cell, when the item is selected from th
list.

Since I want to do math with the result in the linked cell, how can
use vba to return a corresonding numeric value, instead of the tex
value.

I know the listbox created from the "forms" menu, returns a number, bu
I like the versatility of the activex control better. I have tried t
research this question for many days now, and can't find a reference t
this problem.

Has anyone else tried this? Any help is humbly appreciated
 
D

Doug Robbins - Word MVP

Better to ask in the excel.programming newsgroup. But use the .ListIndex
attribute of the listbox + 1

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 
G

Gmann

Sorry, I thought I had posted in excel. Thanks for the answer, ho
would I go about the same operation (below) with a group o
comboboxes?
 
D

Doug Robbins - Word MVP

In the same way. The .ListIndex attribute is the same for both listboxes
and comboboxes.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
G

Gmann

I think I'm starting to make use of it, thanks. One more question?

How do I sum the values (of the selected items ) from 2 differen
comboboxes in a single linked cell? All the selected items will have
value of 1, so it's just 1+1+1 etc. Thank you for your time.
 
D

Doug Robbins - Word MVP

Dim i as Long
i = combobox1.Listindex+1 + combobox2.Listindex+1


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
G

Gmann

I'm sorry, I still haven't learned how to make this work yet.

I've researched the conventions, used some examples to put the correc
code in the worksheets, I still need just a little hand holding? I ma
need to have consulting services.
 
D

Doug Robbins - Word MVP

Send what you have so far to me at (e-mail address removed) and I will take a look and
let you know what needs to be done. If it's as minor as I think it is then
probably there would be no charge at all.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top