Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default DropDowns and item values

Suppose I create a dropdown as following:

Set drp = ActiveWorkbook.Sheets("Sheet1").DropDowns("GroupBy ")
drp.RemoveAllItems
drp.AddItem "Group By", 232
drp.AddItem "Resource", 100
drp.AddItem "Project", 400
drp.ListIndex = 1
end Sub

If the DropDown has Project selected how do I get 400?

These return 3:

MsgBox drp.Value
MsgBox drp.ListIndex

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default DropDowns and item values

the values are not stored in the list. You would need to store them
somewhere or hard code them and figure out what the value is based on the
listindex property.

--
Regards,
Tom Ogilvy

wrote in message
ups.com...
Suppose I create a dropdown as following:

Set drp = ActiveWorkbook.Sheets("Sheet1").DropDowns("GroupBy ")
drp.RemoveAllItems
drp.AddItem "Group By", 232
drp.AddItem "Resource", 100
drp.AddItem "Project", 400
drp.ListIndex = 1
end Sub

If the DropDown has Project selected how do I get 400?

These return 3:

MsgBox drp.Value
MsgBox drp.ListIndex

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default DropDowns and item values

This worked:

drp.List(drp.ListIndex)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default DropDowns and item values

Not for me, not with the code you showed.

that would produce "Project", not 400.

--
Regards,
Tom Ogilvy



wrote in message
ups.com...
This worked:

drp.List(drp.ListIndex)



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default DropDowns and item values

Right.

My bad.

Thanks Tom.

Tom Ogilvy wrote:
Not for me, not with the code you showed.

that would produce "Project", not 400.


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
How do I give numerical values to each text item in a list Tomj37 Excel Discussion (Misc queries) 1 August 4th 08 07:21 PM
make Pivot table show only available values in dropdowns Yaron Assa Excel Discussion (Misc queries) 2 April 3rd 06 07:39 AM
CSV values and retrieiving nth item Christopher Short Excel Worksheet Functions 1 January 26th 06 06:01 PM
How to build a chart with 2 values per item? Boaz Weiss Charts and Charting in Excel 4 December 3rd 04 03:33 AM
Summarizing several item values in one cell Mats Westin Excel Programming 1 February 11th 04 06:00 PM


All times are GMT +1. The time now is 08:05 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"