Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default DropDown list

I am attempting to a drop down list to a cell which is populated from a range of cells held on another sheet

At the moment I am using the Validation method and can successfully populate from a comma delimited string but not from a range that I have from another sheet

Excel::ValidationPtr pValidation = pRange-Validation

pValidation-Delete()
pValidation-Add(Excel::xlValidateList, (CComVariant)xlValidAlertStop, (CComVariant)Excel::xlBetween, (_variant_t)str)
pValidation-IgnoreBlank = VARIANT_TRUE
pValidation-InCellDropdown = VARIANT_TRUE
pValidation-InputTitle = OLESTR("")
pValidation-ErrorMessage = OLESTR("")
pValidation-ShowInput = VARIANT_FALSE
pValidation-ShowError = VARIANT_TRUE

Regards
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default DropDown list

Will,

When using a range on another sheet, it has to be a named range, that is
select the cells in that range, go into InsertNameDefine Name and give it
a meaningful name, then use this name (=myName) in the DV list.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Will" wrote in message
...
I am attempting to a drop down list to a cell which is populated from a

range of cells held on another sheet.

At the moment I am using the Validation method and can successfully

populate from a comma delimited string but not from a range that I have from
another sheet.

Excel::ValidationPtr pValidation = pRange-Validation;

pValidation-Delete();
pValidation-Add(Excel::xlValidateList, (CComVariant)xlValidAlertStop,

(CComVariant)Excel::xlBetween, (_variant_t)str);
pValidation-IgnoreBlank = VARIANT_TRUE;
pValidation-InCellDropdown = VARIANT_TRUE;
pValidation-InputTitle = OLESTR("");
pValidation-ErrorMessage = OLESTR("");
pValidation-ShowInput = VARIANT_FALSE;
pValidation-ShowError = VARIANT_TRUE;

Regards



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
dropdown list determined by another dropdown list Wackyracer Excel Discussion (Misc queries) 5 April 27th 09 10:49 PM
Excell Dropdown List. Display alternate text than found in list. Shawnn Excel Discussion (Misc queries) 14 December 11th 08 07:43 PM
Dropdown List - list item endings not visible if column too narrow AK9955 Excel Discussion (Misc queries) 2 April 27th 07 09:02 AM
result of selecting from the dropdown list should be a dropdown list No News Excel Worksheet Functions 0 July 5th 06 04:09 PM
result of selecting from the dropdown list should be a dropdown list No News Excel Worksheet Functions 2 July 1st 06 10:53 AM


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