Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Cell value as named range for validation list

I have the following code to define a validation list based on the
named range A_CASE_BACK_TYPE
How can I refer to a cell value as opposed to typing the named range.
In short I want to refer to cell "K3" (which has the named range name)
to define the validation list.

Range("E3").Select
With Selection.Validation
.delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertWarning,
Operator _
:=xlBetween, Formula1:="=A_CASE_BACK_TYPE"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "NOT LISTED"
.InputMessage = ""
.ErrorMessage = "YOUR CHOICE IS NOT ON THE LIST"
.ShowInput = True
.ShowError = True
End With

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default Cell value as named range for validation list

With the defined name entered in K3, try =INDIRECT($K$3) as your list source.

" wrote:

I have the following code to define a validation list based on the
named range A_CASE_BACK_TYPE
How can I refer to a cell value as opposed to typing the named range.
In short I want to refer to cell "K3" (which has the named range name)
to define the validation list.

Range("E3").Select
With Selection.Validation
.delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertWarning,
Operator _
:=xlBetween, Formula1:="=A_CASE_BACK_TYPE"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "NOT LISTED"
.InputMessage = ""
.ErrorMessage = "YOUR CHOICE IS NOT ON THE LIST"
.ShowInput = True
.ShowError = True
End With


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Cell value as named range for validation list

Thank you very much for the reply...I had a problem with your tip and
came up with the following that appears to work. Your use of the
INDIRECT function greatly helped another issue that I was having.
Thanks again,
Bill

Range("E3").Select
With Selection.Validation
.delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertWarning,
Operator _
:=xlBetween, Formula1:=Range("K3").Value
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "NOT LISTED"
.InputMessage = ""
.ErrorMessage = "YOUR CHOICE IS NOT ON THE LIST"
.ShowInput = True
.ShowError = True
End With

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
Data Validation List from a Dynamic Named Range on Another Workshe Jeremy Excel Worksheet Functions 5 March 29th 10 09:26 AM
Changing named Validation list to Dynamic list. GlenC Excel Discussion (Misc queries) 1 July 20th 06 11:49 PM
Remove empty cells from named list / validation list Sp00k Excel Worksheet Functions 4 April 28th 06 03:45 PM
Using a data validation list to look up a defined named range in another worksheet Laura Hunt Charts and Charting in Excel 0 November 24th 05 02:29 PM
named range, data validation: list non-selected items, and new added items KR Excel Discussion (Misc queries) 1 June 24th 05 05:21 AM


All times are GMT +1. The time now is 08:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"