LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Formula1 Property of Validation Object to refer to function name

In Excel 2003, how do I get the Formula1 property of the Validation
object to refer to a function name?

This gives me error 1004:

Sub Macro1()

With Selection.Validation
.Delete
'.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:="=$A$15:$A$19" 'recorded my macro
recorder, works fine.
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:=GetList
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub


Public Function GetList()
Dim arrayList(1 To 5) As String

arrayList(1) = "aaa"
arrayList(2) = "ccc"
arrayList(3) = "bbb"
arrayList(4) = "ddd"
arrayList(5) = "eee"

GetList = arrayList
End Function

 
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
Possible to refer to a sheet's object name ? kittronald Excel Worksheet Functions 1 August 23rd 11 11:30 PM
How do I use the .Cells property to refer to ActiveCell? Caeres Excel Discussion (Misc queries) 9 October 7th 08 02:56 PM
More then 1 Excel object running at same time , how can I refer to right one in code? Dave Lauberts Excel Programming 5 October 28th 04 03:57 PM
refer to the sheets Name property in my code (not what is on the Tab) Sandy[_5_] Excel Programming 3 January 29th 04 08:45 PM
"Select Column method or property not available because some/all of object doesn't refer to table" Steven Rosenberg Excel Programming 0 August 18th 03 04:41 AM


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