I tested this on a basic function =1+2 and it worked great, then I tried
it on my more complex equation and it didn't work. So I am just going
to paste the equation that I am working with and see if you can help me
further. Thanks again.
Equation that I need to concatenate and execute.
='I:\SECURED\B&H RECONCILIATIONS\[656158.XLS]SUBMIT'!$L$9
I am pulling the file name (656158) from cell D92.
As we process another form it outputs a new workbook named after the
reference number. Then this file is populated by our A/R devision. I
am trying to create a way that their file that contains this number can
go out to the directory and see if there is a file with that name and
then check the value of a certain cell ($L$9) on that file. If it
comes back with a value then we know a file has been processed with
that matches the entry if not we will get an error message because no
such file exists. I have asked a couple times if there was a way to
just pull the value for a cell and insert it into an equation as above
and no one really had a solution that would work, so I am trying to
create a work around with this concatenate.
Here is the info I have in each cell...
L92: =
M92: 'I:\SECURED\B&H Reconciliations\[
N92: =D92
O92: .xls]Submit'!$L$9
When I run a basic concatenate then it gives me the equation the way I
need it but it does't execute as you know. When I run it with your
custom function it gives me a #VALUE! error. Any suggestions...?
Thanks again for your help, I truly need it!
Mike (Nashville)
Dave said:
It's actually two lines:
Public Function CONCandEVAL(ParamArray rng())
Dim stemp As String
Dim i As Long
For i = LBound(rng()) To UBound(rng())
stemp = stemp & rng(i)
Next i
CONCandEVAL = Evaluate(stemp)
End Function
http://www.excelforum.com/showthread.php?threadid=476780