Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default make a named range with an array not using a workseet cell range


I know I can just make a list in a worksheet and name it but I would like to know if there is a way to just manually
input an array into the named range. I tried this but it does not work. I see that the Refers to is correct but the values
is not set. Ultimately this will be used for a dropdown list. Thanks for any help.


Dim MyWeek

MyWeek = Array("","Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")

Names.Add Name:="Typelist", RefersTo:=MyWeek
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.misc
external usenet poster
 
Posts: 226
Default make a named range with an array not using a workseet cell range

It happens that John S. formulated :
I know I can just make a list in a worksheet and name it but I would like to
know if there is a way to just manually input an array into the named range.
I tried this but it does not work. I see that the Refers to is correct but
the values is not set. Ultimately this will be used for a dropdown list.
Thanks for any help.


Dim MyWeek

MyWeek = Array("","Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")

Names.Add Name:="Typelist", RefersTo:=MyWeek


Validation lists must be a delimited list OR a reference to a range
that contains a list. If you want to add Validation for a specific list
to any cell then this might be the way to go...

With Selection.Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Formula1:="Mon,Tue,Wed,Thu,Fri,Sat,Sun"
.IgnoreBlank = True: .InCellDropdown = True
.ShowInput = True: .ShowError = True
End With

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


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
make a named range with an array not using a workseet cell range John S.[_5_] Excel Programming 0 November 12th 10 06:07 PM
make a named range with an array not using a workseet cell range John S.[_5_] Excel Programming 0 November 12th 10 06:06 PM
make a named range with an array not using a workseet cell range John S.[_5_] Excel Programming 0 November 12th 10 06:05 PM
Named range in workseet code Dave Excel Programming 8 December 21st 09 11:29 PM
Array as a "named range" - formula ok in cells, but error as "named range" tskogstrom Excel Discussion (Misc queries) 11 December 28th 06 04:44 PM


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