View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Adding Validation (drop down)

and you could not do

=Getsomedata()

in a cell with that function - it would just return #Value

I don't know if that is what you are trying to do, but if it is, it won't
work. At least it won't work with this VBA function. If an xll can get
around that limitation, I can't say, but if you are having problems and
attempting that, then I would think it can't.

--
Regards,
Tom Ogilvy

"Will" wrote in message
...
Many thanks for your reply

My registered function in xl returns a string but inbetween it has access

to the active sheet/active cell and attempts to create a dropdown combo
containing a set of values, using the Validation object much in the same
way the following vba code would do.

Function GetSomeData() as string

dim str as string
' do some work to populate the string

ActiveCell.Select
ActiveCell.Clear
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,

Operator:=xlBetween, Formula1:=str
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = False
.ShowError = True
End With
GetSomeData = GetFirstString(str) '
End Function