Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
As it is your function is not passing a value back to the main
procedure. Try changing it to: Function valcal(val, mrn) Dim r, c As Integer Dim yr As String Dim fndCell As Range With mrn Set fndCell = .Find(What:=val, LookIn:=xlValues, LookAt:= _ xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext _ , MatchCase:=False) If Not fndCell Is Nothing Then r = fndCell.Row c = fndCell.Column yr = Cells(r, 1).Value valcal = Right("0" & c, 2) & yr '<<changed End If End With End Function Hope this helps Rowan jesmin wrote: Hi rown: In the 2nd call, fndcell is empty. The range selection is perfect. Its selecting the required columns. Only it canot find the value. Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
checking that cells have a value before the workbook will close | Excel Worksheet Functions | |||
Help with using range names in sum function | Excel Worksheet Functions | |||
function problem regarding cell range | Excel Worksheet Functions | |||
Array to named range conversion... | Excel Discussion (Misc queries) | |||
Problem with an "if" relating to a range | Excel Worksheet Functions |