View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andy Andy is offline
external usenet poster
 
Posts: 414
Default I need some checking done

Hello all i wrote a vb function and it doesnt seem to be working, help me out
and check it over

Here is the code:

Dim Amps As Range
Dim BrkL As Range
Dim CondMat As Variant
Dim CondTemp As Variant
Dim Conduit As Variant
Dim CondInsul As Variant
Dim CondTbl As Worksheet
Dim FeedEst As Worksheet
Dim Conductor As String

Public Function CdLkUp(BrkL, Amps, CondMat, CondTemp) As Variant

Set CondTbl = Worksheets("Conductor Tables")
Set FeedEst = Worksheets("Feeder Est.")

Select Case Amps
Case Is <= 20
CondLookup = CondTbl.Range("S43")

Select Case CondMat
Case Is = "Cu"
Select Case CondTemp
Case Is = 60
CdLkUp = Application.WorksheetFunction.VLookup(BrkL, _
CondTbl.Range("b10:e39"), 4, True)
Case Is = 75
CdLkUp = Application.WorksheetFunction.VLookup(BrkL, _
CondTbl.Range("c10:e39"), 3, True)
Case Is = 90
CdLkUp = Application.WorksheetFunction.VLookup(BrkL, _
CondTbl.Range("d10:e39"), 2, True)
End Select
Case Is = "Al"
Select Case CondTemp
Case Is = 60
CdLkUp = Application.WorksheetFunction.VLookup(BrkL, _
CondTbl.Range("f10:i39"), 4, True)
Case Is = 75
CdLkUp = Application.WorksheetFunction.VLookup(BrkL, _
CondTbl.Range("g10:i39"), 3, True)
Case Is = 90
CdLkUp = Application.WorksheetFunction.VLookup(BrkL, _
CondTbl.Range("h10:i39"), 2, True)
End Select
End Select
End Select
End Function