Reply
 
Thread Tools Display Modes
  #1   Report Post  
Gmann Gmann is offline
Junior Member
 
Posts: 0
Default change control listbox results to numbers

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

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

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

Has anyone else tried this? Any help is humbly appreciated.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default change control listbox results to numbers

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.

"Gmann" wrote in message
...

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

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

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

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




--
Gmann


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default change control listbox results to numbers

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.

"Gmann" wrote in message
...

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

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

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

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




--
Gmann


  #4   Report Post  
Gmann Gmann is offline
Junior Member
 
Posts: 0
Default

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


  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default change control listbox results to numbers

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

"Gmann" wrote in message
...

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


Doug Robbins - Word MVP;457857 Wrote:
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.

"Gmann" wrote in message
...-

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

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

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

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




--
Gmann -





--
Gmann




  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default change control listbox results to numbers


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

"Gmann" wrote in message
...

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


Doug Robbins - Word MVP;457857 Wrote:
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.

"Gmann" wrote in message
...-

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

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

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

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




--
Gmann -





--
Gmann


  #7   Report Post  
Gmann Gmann is offline
Junior Member
 
Posts: 0
Default

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 different comboboxes in a single linked cell? All the selected items will have a value of 1, so it's just 1+1+1 etc. Thank you for your time.


  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default change control listbox results to numbers

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

"Gmann" wrote in message
...

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 different
comboboxes in a single linked cell? All the selected items will have a
value of 1, so it's just 1+1+1 etc. Thank you for your time.


Doug Robbins - Word MVP;458172 Wrote:
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

"Gmann" wrote in message
...-

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


Doug Robbins - Word MVP;457857 Wrote:-
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.

"Gmann"
wrote in message
...-

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

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

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

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




--
Gmann --




--
Gmann -





--
Gmann


  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default change control listbox results to numbers

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

"Gmann" wrote in message
...

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 different
comboboxes in a single linked cell? All the selected items will have a
value of 1, so it's just 1+1+1 etc. Thank you for your time.


Doug Robbins - Word MVP;458172 Wrote:
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

"Gmann" wrote in message
...-

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


Doug Robbins - Word MVP;457857 Wrote:-
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.

"Gmann"
wrote in message
...-

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

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

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

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




--
Gmann --




--
Gmann -





--
Gmann


  #10   Report Post  
Gmann Gmann is offline
Junior Member
 
Posts: 0
Default

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 correct code in the worksheets, I still need just a little hand holding? I may need to have consulting services.


Quote:
Originally Posted by Doug Robbins - Word MVP View Post
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

"Gmann" wrote in message
...

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 different
comboboxes in a single linked cell? All the selected items will have a
value of 1, so it's just 1+1+1 etc. Thank you for your time.


Doug Robbins - Word MVP;458172 Wrote:
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

"Gmann"
wrote in message
...-

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


Doug Robbins - Word MVP;457857 Wrote:-
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.

"Gmann"
wrote in message
...-

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

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

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

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




--
Gmann --




--
Gmann -





--
Gmann


  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default change control listbox results to numbers

Send what you have so far to me at 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

"Gmann" wrote in message
...

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 correct
code in the worksheets, I still need just a little hand holding? I may
need to have consulting services.


Doug Robbins - Word MVP;458402 Wrote:
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

"Gmann"
wrote in message
...-

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 different
comboboxes in a single linked cell? All the selected items will have
a
value of 1, so it's just 1+1+1 etc. Thank you for your time.


Doug Robbins - Word MVP;458172 Wrote:-
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

"Gmann"
wrote in message
...-

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


Doug Robbins - Word MVP;457857 Wrote:-
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.

"Gmann"
wrote in message
...-

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

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

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

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




--
Gmann --




--
Gmann --




--
Gmann -





--
Gmann


  #12   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default change control listbox results to numbers

Send what you have so far to me at 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

"Gmann" wrote in message
...

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 correct
code in the worksheets, I still need just a little hand holding? I may
need to have consulting services.


Doug Robbins - Word MVP;458402 Wrote:
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

"Gmann"
wrote in message
...-

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 different
comboboxes in a single linked cell? All the selected items will have
a
value of 1, so it's just 1+1+1 etc. Thank you for your time.


Doug Robbins - Word MVP;458172 Wrote:-
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

"Gmann"
wrote in message
...-

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


Doug Robbins - Word MVP;457857 Wrote:-
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.

"Gmann"
wrote in message
...-

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

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

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

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




--
Gmann --




--
Gmann --




--
Gmann -





--
Gmann


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing features of a blocked text results in the change of every CK Microsoft Word Help 2 October 1st 07 09:29 PM
Changing features of a blocked text results in change of the entre CK Microsoft Word Help 3 October 1st 07 09:29 PM
how do I control page numbers in a section break? Danno Page Layout 2 October 19th 06 07:09 PM
Change placement of translation results so they are in view. GrandmaSiobhan Microsoft Word Help 0 November 29th 05 08:36 PM
using control center then change to control left takes the item c. mike Microsoft Word Help 4 February 14th 05 03:12 PM


All times are GMT +1. The time now is 03:33 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"