View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default New Add-in in Excel 2003 - Huge Problem

Public Function Intersect(ByVal Target As Range, Lookup1 As Variant, lookup2
As Variant)
Dim mpCell1 As Range
Dim mpCell2 As Range

Set mpCell1 = Target.Rows(1).Find(Lookup1)
Set mpCell2 = Target.Columns(1).Find(lookup2)
If mpCell1 Is Nothing Then
Intersect = "#Invalid column lookup"
ElseIf mpCell2 Is Nothing Then
Intersect = "#Invalid row lookup"
Else
Intersect = Target.Cells(mpCell2.Row, mpCell1.Column)
End If
End Function


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Irfan Khan" wrote in message
...
Hi,

Thanks for the solution but I require it in my VBA code so that i can
create
my own function and can use as an Add-In for excel.



"Bob Phillips" wrote:

You don't need code

=INDEX(A1:F11,MATCH(TS,A:A,0),MATCH(GOS,1:1,0))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Irfan Khan" wrote in message
...
Hi Bob,

Thanks for reponding. I am having following table -

TS
|
V

0.01 0.05 0.1 0.5 1 <- GOS
1 0.00 0.00 0.00 0.01 0.01
2 0.01 0.03 0.05 0.11 0.15
3 0.09 0.15 0.19 0.35 0.46
4 0.23 0.36 0.44 0.70 0.87
5 0.45 0.65 0.76 1.13 1.36
6 0.73 1.00 1.15 1.62 1.91
7 1.05 1.39 1.58 2.16 2.50
8 1.42 1.83 2.05 2.73 3.13
9 1.83 2.30 2.56 3.33 3.78
10 2.26 2.80 3.09 3.96 4.46

Now I need to develop an Add-In Which will be containing a formula,
ay -

Function ErlB(TimeSlots,GOS)

.........
........


End Function

Function should return corresponding value according to TimeSlots and
GOS...



"Bob Phillips" wrote:

What have you got, and how is it wrong/not working, etc.?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Irfan Khan" wrote in message
...
Hi all,

i have created a new Add-in in excel2003 with two new functions.
What I
require is functions should return vlookup values from a particular
table
which already there as a worksheet in Add-In. Can somebody help me
please...

Thanks & Cheers -

Irfan Khan