PDA

View Full Version : custom function error.



next
04-14-2008, 01:07 PM
I'm trying to create a custom function to use in my spread sheet, but it return a #NAME error, what am i doing wrong?
Option Explicit

Function PV_list(WOs As Range) As String
Dim r As Range
Dim list As String
For Each r In WOs
list = list & "^" & r.Value
Next r
PV_list = list
End Function

Here is what it does:
Lets say A1 = a, A2 = b and A3 = c, by typing =PV_list(A1:A3) is should get the following output: a^b^c
This is saved in PERSONAL.xls.
:help
Thanks.

mdmackillop
04-14-2008, 01:36 PM
=PERSONAL.XLS!PV_list(A1:A4)

next
04-14-2008, 01:43 PM
Thanks, it's working, but is there any way to make it so that i won't have to type "=personal.xls!" all the time?

mdmackillop
04-14-2008, 01:53 PM
You could save the function in an Add-In (XLA file) See here (http://vbaexpress.com/forum/showthread.php?t=10855)

next
04-14-2008, 03:21 PM
Thanks i'll check that out! :beerchug: